mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Correction socket
This commit is contained in:
parent
c9b76df2cd
commit
9286fe6b9c
2 changed files with 20 additions and 10 deletions
|
|
@ -17,6 +17,7 @@ describe('StudentWaitPage Component', () => {
|
||||||
launchQuiz: jest.fn(),
|
launchQuiz: jest.fn(),
|
||||||
roomName: 'Test Room',
|
roomName: 'Test Room',
|
||||||
setQuizMode: jest.fn(),
|
setQuizMode: jest.fn(),
|
||||||
|
setIsRoomSelectionVisible: jest.fn()
|
||||||
};
|
};
|
||||||
|
|
||||||
test('renders StudentWaitPage with correct content', () => {
|
test('renders StudentWaitPage with correct content', () => {
|
||||||
|
|
@ -39,5 +40,4 @@ describe('StudentWaitPage Component', () => {
|
||||||
|
|
||||||
expect(screen.getByRole('dialog')).toBeInTheDocument();
|
expect(screen.getByRole('dialog')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
})
|
|
||||||
|
|
|
||||||
|
|
@ -201,6 +201,16 @@ const ManageRoom: React.FC = () => {
|
||||||
webSocketService.launchStudentModeQuiz(roomName, quizQuestions);
|
webSocketService.launchStudentModeQuiz(roomName, quizQuestions);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
socket.on('join-failure', (message) => {
|
||||||
|
setConnectingError(message);
|
||||||
|
setSocket(null);
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.on('user-disconnected', (userId: string) => {
|
||||||
|
console.log(`Student left: id = ${userId}`);
|
||||||
|
setStudents((prevUsers) => prevUsers.filter((user) => user.id !== userId));
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (rooms.length === 0) {
|
if (rooms.length === 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue