mirror of
https://github.com/Discreetly/server.git
synced 2026-01-09 12:37:58 -05:00
feat(api): Updated createRoom function to return room ID
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user