diff --git a/client/src/__tests__/components/LiveResults/LiveResults.test.tsx b/client/src/__tests__/components/LiveResults/LiveResults.test.tsx index 2083361..a211327 100644 --- a/client/src/__tests__/components/LiveResults/LiveResults.test.tsx +++ b/client/src/__tests__/components/LiveResults/LiveResults.test.tsx @@ -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( { }); }); + test('highlights the cell of the selected question', () => { + render( + + ); + + // 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( + + ); + + const showAnswersSwitch = screen.getByLabelText('Afficher les réponses'); + expect((showAnswersSwitch as HTMLInputElement).checked).toBe(true); + }); + });