mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
parent
c13a38af70
commit
5edd556688
2 changed files with 13 additions and 13 deletions
|
|
@ -227,7 +227,7 @@ test('calls showSelectedQuestion when a table cell is clicked', () => {
|
|||
expect(mockShowSelectedQuestion).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test.skip('toggles the visibility of content when the arrow button is clicked', () => {
|
||||
test('toggles the visibility of content when the arrow button is clicked', () => {
|
||||
render(<LiveResults
|
||||
socket={null}
|
||||
questions={mockQuestions}
|
||||
|
|
@ -235,19 +235,16 @@ test.skip('toggles the visibility of content when the arrow button is clicked',
|
|||
quizMode="teacher"
|
||||
students={mockStudents}
|
||||
/>);
|
||||
const toggleSwitch = screen.getByTestId("liveResults-visibility-switch");
|
||||
fireEvent.click(toggleSwitch);
|
||||
const toggleSwitch = screen.getByTestId("liveResults-switch");
|
||||
expect(toggleSwitch).toBeInTheDocument();
|
||||
|
||||
expect(toggleSwitch).toBeChecked();
|
||||
expect(screen.queryByText('Afficher les noms')).toBeInTheDocument();
|
||||
expect(screen.queryByText('Afficher les réponses')).toBeInTheDocument();
|
||||
expect(screen.queryByTestId('table-container')).toBeInTheDocument();
|
||||
|
||||
|
||||
fireEvent.click(toggleSwitch);
|
||||
screen.debug();
|
||||
|
||||
expect(toggleSwitch).not.toBeChecked();
|
||||
expect(screen.queryByText('Afficher les noms')).not.toBeInTheDocument();
|
||||
expect(screen.queryByText('Afficher les réponses')).not.toBeInTheDocument();
|
||||
expect(screen.queryByTestId('table-container')).not.toBeInTheDocument();
|
||||
|
|
|
|||
|
|
@ -36,13 +36,16 @@ const LiveResults: React.FC<LiveResultsProps> = ({ questions, showSelectedQuesti
|
|||
<div>
|
||||
<div className="action-bar">
|
||||
<div>
|
||||
<FormControlLabel
|
||||
label={<div className="text-sm">Résultats du quiz</div>}
|
||||
control={
|
||||
<Switch
|
||||
data-testid="liveResults-visibility-switch"
|
||||
data-testid="liveResults-switch"
|
||||
checked={isExpanded}
|
||||
onChange={() => toggleExpand()}
|
||||
inputProps={{ 'aria-label': 'toggle visibility' }}
|
||||
/>
|
||||
<span>Résultats du quiz</span>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{isExpanded && (
|
||||
<FormGroup row className='form-group'>
|
||||
|
|
|
|||
Loading…
Reference in a new issue