diff --git a/client/src/modules/game_state/states/InProgress.js b/client/src/modules/game_state/states/InProgress.js index de790b6..437ed63 100644 --- a/client/src/modules/game_state/states/InProgress.js +++ b/client/src/modules/game_state/states/InProgress.js @@ -481,9 +481,9 @@ function removeExistingPlayerElements (killPlayerHandlers, revealRoleHandlers) { }); } -function displayCurrentModerator(moderator) { - document.getElementById("current-moderator-name").innerText = moderator.name; - document.getElementById("current-moderator-type").innerText = moderator.userType + globals.USER_TYPE_ICONS[moderator.userType]; +function displayCurrentModerator (moderator) { + document.getElementById('current-moderator-name').innerText = moderator.name; + document.getElementById('current-moderator-type').innerText = moderator.userType + globals.USER_TYPE_ICONS[moderator.userType]; } function createEndGamePromptComponent (socket, stateBucket) { diff --git a/spec/unit/server/modules/Events_Spec.js b/spec/unit/server/modules/Events_Spec.js index 8f2a835..d8e910a 100644 --- a/spec/unit/server/modules/Events_Spec.js +++ b/spec/unit/server/modules/Events_Spec.js @@ -263,7 +263,7 @@ describe('Events', () => { expect(namespace.in).toHaveBeenCalledWith(game.accessCode); expect(namespace.in().emit).toHaveBeenCalledWith( EVENT_IDS.KILL_PLAYER, - 'b' + game.people.find(p => p.id === 'b') ); }); }); @@ -433,7 +433,7 @@ describe('Events', () => { expect(namespace.to().emit).toHaveBeenCalledWith(EVENT_IDS.SYNC_GAME_STATE); // verify the "kill player" event is sent to everyone but the sender expect(mockSocket.to).toHaveBeenCalledWith(game.accessCode); - expect(socketToObj.emit).toHaveBeenCalledWith(EVENT_IDS.KILL_PLAYER, 'a'); + expect(socketToObj.emit).toHaveBeenCalledWith(EVENT_IDS.KILL_PLAYER, game.people.find(p => p.id === 'a')); }); it('should not communicate to the current or previous mod if their sockets are not found', async () => { game.currentModeratorId = 'a'; @@ -461,7 +461,7 @@ describe('Events', () => { expect(namespace.to().emit).not.toHaveBeenCalled(); // verify the "kill player" event is sent to everyone in the room (as opposed to everyone but the sender) expect(namespace.in).toHaveBeenCalledWith(game.accessCode); - expect(namespace.in().emit).toHaveBeenCalledWith(EVENT_IDS.KILL_PLAYER, 'a'); + expect(namespace.in().emit).toHaveBeenCalledWith(EVENT_IDS.KILL_PLAYER, game.people.find(p => p.id === 'a')); }); }); });