feat(api): Updated createRoom function to return room ID

This commit is contained in:
2023-09-06 11:55:27 -04:00
parent 7035f4a689
commit cd70acac03
3 changed files with 11 additions and 6 deletions

View File

@@ -30,7 +30,7 @@ const room = {
type: 'PUBLIC_CHAT'
};
const roomByIdTest = genId(serverConfig.id as bigint, room.roomName).toString();
let roomByIdTest: string;
let testCode = '';
const testIdentity = randBigint();
const username = 'admin';
@@ -59,7 +59,12 @@ describe('Endpoints should all work', () => {
.then((res) => {
try {
expect(res.body).toEqual({ message: 'Room created successfully' });
console.log(res);
expect(res.status).toEqual(200);
const result = res.body;
expect(res.body.message).toEqual('Room created successfully');
expect(result.roomId).toBeDefined();
roomByIdTest = result.roomId;
} catch (error) {
console.warn('POST /room/add - ' + error);
}