mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Compare commits
No commits in common. "81c530eac6bc4084c68681f1e31559bfd6cc6745" and "c9b76df2cd489b392d3bd127a1d069a20539002c" have entirely different histories.
81c530eac6
...
c9b76df2cd
3 changed files with 13 additions and 20 deletions
|
|
@ -17,7 +17,6 @@ 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', () => {
|
||||||
|
|
@ -40,4 +39,5 @@ describe('StudentWaitPage Component', () => {
|
||||||
|
|
||||||
expect(screen.getByRole('dialog')).toBeInTheDocument();
|
expect(screen.getByRole('dialog')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
})
|
||||||
|
|
|
||||||
|
|
@ -201,16 +201,6 @@ 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) {
|
||||||
|
|
@ -243,6 +233,7 @@ const ManageRoom: React.FC = () => {
|
||||||
console.log(`Listening for user-joined in room ${roomName}`);
|
console.log(`Listening for user-joined in room ${roomName}`);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
socket.on('user-joined', (_student: StudentType) => {
|
socket.on('user-joined', (_student: StudentType) => {
|
||||||
|
console.log("📢 Nouvel étudiant ajouté:", _student);
|
||||||
if (quizMode === 'teacher') {
|
if (quizMode === 'teacher') {
|
||||||
webSocketService.nextQuestion(roomName, currentQuestion);
|
webSocketService.nextQuestion(roomName, currentQuestion);
|
||||||
} else if (quizMode === 'student') {
|
} else if (quizMode === 'student') {
|
||||||
|
|
|
||||||
|
|
@ -254,6 +254,8 @@ describe('Rooms', () => {
|
||||||
|
|
||||||
it('should return false if room does not exist', async () => {
|
it('should return false if room does not exist', async () => {
|
||||||
const title = 'Nonexistent Room';
|
const title = 'Nonexistent Room';
|
||||||
|
const userId = '12345';
|
||||||
|
|
||||||
// Mock the database response
|
// Mock the database response
|
||||||
collection.findOne.mockResolvedValue(null);
|
collection.findOne.mockResolvedValue(null);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue