Skip to content

Commit

Permalink
ran linter
Browse files Browse the repository at this point in the history
  • Loading branch information
VeronicaPim committed Oct 10, 2024
1 parent 6b53eaa commit 002b295
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions test/posts/uploads.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,53 +366,53 @@ describe('post uploads management', () => {
});

// tests created for checkbox frontend feature - copilot helped
describe('Chat Composer Component', function () {
let uid, tid, cid;

describe('Chat Composer Component', () => {
let uid; let tid; let
cid;

before(async () => {
// Set up user, category, and topic for testing chat composer
uid = await user.create({
username: 'chatUser',
password: 'password123',
gdpr_consent: 1,
});

({ cid } = await categories.create({
name: 'Test Category',
description: 'A category for chat testing',
}));

const topicPostData = await topics.post({
uid,
cid,
title: 'Chat Composer Test Topic',
content: 'Initial content for testing',
});

tid = topicPostData.topicData.tid;
});

it('should render chat composer in a topic', async () => {
const response = await request(app)

Check failure on line 397 in test/posts/uploads.js

View workflow job for this annotation

GitHub Actions / test

'request' is not defined

Check failure on line 397 in test/posts/uploads.js

View workflow job for this annotation

GitHub Actions / test

'app' is not defined
.get(`/topic/${tid}`) // Adjust route based on your app
.get(`/topic/${tid}`) // Adjust route based on your app
.expect(200);

assert(response.text.includes('component="chat/composer"'));
});

it('should allow user to send a message', async () => {
const response = await request(app)

Check failure on line 405 in test/posts/uploads.js

View workflow job for this annotation

GitHub Actions / test

'request' is not defined

Check failure on line 405 in test/posts/uploads.js

View workflow job for this annotation

GitHub Actions / test

'app' is not defined
.post(`/api/chat/send`) // Adjust with actual API endpoint
.post(`/api/chat/send`) // Adjust with actual API endpoint
.send({
uid,
tid,
message: 'Hello from the chat composer!',
})
.expect(200);

assert(response.body.success, true);
assert(response.body.message, 'Hello from the chat composer!');
});
});

});

0 comments on commit 002b295

Please sign in to comment.