mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Deux nouveaux tests (qui ne passent pas)
This commit is contained in:
parent
331ff33d5b
commit
9fbe2920cc
1 changed files with 35 additions and 1 deletions
|
|
@ -175,7 +175,7 @@ describe('LiveResults', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('displays the chosen answer in a question cell', () => {
|
test('displays the submitted answer(s) in a question cell', () => {
|
||||||
render(
|
render(
|
||||||
<LiveResults
|
<LiveResults
|
||||||
socket={mockSocket}
|
socket={mockSocket}
|
||||||
|
|
@ -204,4 +204,38 @@ describe('LiveResults', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('highlights the cell of the selected question', () => {
|
||||||
|
render(
|
||||||
|
<LiveResults
|
||||||
|
socket={mockSocket}
|
||||||
|
questions={mockQuestions}
|
||||||
|
showSelectedQuestion={jest.fn()}
|
||||||
|
quizMode="teacher"
|
||||||
|
students={mockStudents}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
// Select the first question
|
||||||
|
const questionCell = screen.getByText(`Q${1}`);
|
||||||
|
fireEvent.click(questionCell);
|
||||||
|
|
||||||
|
// Check if the selected question is highlighted
|
||||||
|
expect(questionCell.closest('th')?.classList.contains('selected-question')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Show answers should be enabled by default', () => {
|
||||||
|
render(
|
||||||
|
<LiveResults
|
||||||
|
socket={mockSocket}
|
||||||
|
questions={mockQuestions}
|
||||||
|
showSelectedQuestion={jest.fn()}
|
||||||
|
quizMode="teacher"
|
||||||
|
students={mockStudents}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
const showAnswersSwitch = screen.getByLabelText('Afficher les réponses');
|
||||||
|
expect((showAnswersSwitch as HTMLInputElement).checked).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue