@@ -11,16 +11,6 @@ describe('create room', () => {
1111 expect ( Packet . getPayload ( response , 'joinResponse' ) ?. room ?. name ) . toEqual ( 'room' ) ;
1212 client . exit ( ) ;
1313 } ) ;
14- // it('create a room', async () => {
15- // const [client] = createClients();
16- // await client.connect();
17- // await client.request(Messages.getLogin(client.newId(), 'batman'));
18- // const response = await client.request(Messages.getCreateRoom(client.newId(), 'party room'));
19- // expect(Packet.getPayload(response, 'createRoomResponse')?.room?.id).toEqual(
20- // expect.any(String),
21- // );
22- // client.exit();
23- // });
2414
2515 it ( 'create a room, join and then leave' , async ( ) => {
2616 const [ client ] = createClients ( ) ;
@@ -31,57 +21,4 @@ describe('create room', () => {
3121 expect ( Packet . isStatusOk ( leaveResponse ) ) . toBe ( true ) ;
3222 client . exit ( ) ;
3323 } ) ;
34-
35- // it('create a room and a client join', async () => {
36- // const [host, client] = createClients(2);
37- // const hostId = await connectAndLogin(host);
38- // const clientId = await connectAndLogin(client);
39-
40- // const createRoomResponse = await host.request(
41- // Messages.getCreateRoom(host.newId(), 'party room'),
42- // );
43- // const roomId = Packet.getPayload(createRoomResponse, 'createRoomResponse')?.room?.id;
44- // expect(roomId).toBeDefined();
45- // if (roomId) {
46- // const [hostRoomUpdateResult, clientJoinResponse] = await Promise.all([
47- // waitForRoomUpdate(host),
48- // client
49- // .request(Messages.getJoin(client.newId(), roomId))
50- // .then((response) => Packet.getPayload(response, 'joinResponse')),
51- // ]);
52-
53- // expect(clientJoinResponse?.roomState?.players.length).toBe(2);
54- // expect(clientJoinResponse?.roomState?.hostId).toBe(hostId);
55- // expect(clientJoinResponse?.roomState?.token).toEqual(expect.any(String));
56- // expect(hostRoomUpdateResult.token).toEqual(
57- // expect.objectContaining({
58- // previousToken: expect.any(String),
59- // token: expect.any(String),
60- // }),
61- // );
62- // }
63-
64- // host.exit();
65- // client.exit();
66- // });
67-
68- // it('in a room everyone leaves', async () => {
69- // const [host, guest] = await createLoginedClients(2);
70- // const createResponse = await host.request(Messages.getCreateRoom(host.newId(), 'room'));
71- // const roomId = Packet.getPayload(createResponse, 'createRoomResponse')?.room?.id;
72- // expect(roomId).toBeDefined();
73- // if (roomId) {
74- // await Promise.all([
75- // waitForRoomUpdate(host),
76- // guest.request(Messages.getJoin(guest.newId(), roomId)),
77- // ]);
78- // await Promise.all([
79- // waitForRoomUpdate(guest),
80- // host.request(Messages.getLeave(host.newId())),
81- // ]);
82- // await guest.request(Messages.getLeave(guest.newId()));
83- // }
84- // host.exit();
85- // guest.exit();
86- // });
8724} ) ;
0 commit comments