강동현

준비하면 updateRoomUser가 수신되는지에 관한 테스트 추가

...@@ -23,10 +23,28 @@ describe("준비", () => { ...@@ -23,10 +23,28 @@ describe("준비", () => {
23 } = prepareJoinedRoom(1, 2, true); 23 } = prepareJoinedRoom(1, 2, true);
24 24
25 expect(room.isReady(user)).eq(false); 25 expect(room.isReady(user)).eq(false);
26 +
26 socket.testOk("ready", { ready: true }); 27 socket.testOk("ready", { ready: true });
27 expect(room.isReady(user)).eq(true); 28 expect(room.isReady(user)).eq(true);
29 + expect(socket.socket.received("updateRoomUser")).deep.eq({
30 + state: "updated",
31 + user: {
32 + username: user.username,
33 + admin: false,
34 + ready: true,
35 + },
36 + });
37 +
28 socket.testOk("ready", { ready: false }); 38 socket.testOk("ready", { ready: false });
29 expect(room.isReady(user)).eq(false); 39 expect(room.isReady(user)).eq(false);
40 + expect(socket.socket.received("updateRoomUser")).deep.eq({
41 + state: "updated",
42 + user: {
43 + username: user.username,
44 + admin: false,
45 + ready: false,
46 + },
47 + });
30 }); 48 });
31 it("방장은 준비할 수 없습니다", () => { 49 it("방장은 준비할 수 없습니다", () => {
32 const { 50 const {
......