Skip to content

Commit dd9d8ab

Browse files
committed
Fix test assertions for hideInternalTopics toggle behavior
Update the test in ListPage.spec.tsx to correctly assert the initial state of 'hideInternalTopics' as truthy, then toggling to falsy and back to truthy. This ensures the test matches the component's new behavior.
1 parent bea9749 commit dd9d8ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

frontend/src/components/Topics/List/__tests__/ListPage.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ describe('ListPage Component', () => {
3636
const switchInput = screen.getByLabelText('Show Internal Topics');
3737
expect(switchInput).toBeInTheDocument();
3838

39-
expect(global.localStorage.getItem('hideInternalTopics')).toBeNull();
40-
await userEvent.click(switchInput);
4139
expect(global.localStorage.getItem('hideInternalTopics')).toBeTruthy();
4240
await userEvent.click(switchInput);
43-
expect(global.localStorage.getItem('hideInternalTopics')).toBeNull();
41+
expect(global.localStorage.getItem('hideInternalTopics')).toBeFalsy();
42+
await userEvent.click(switchInput);
43+
expect(global.localStorage.getItem('hideInternalTopics')).toBeTruthy();
4444
});
4545

4646
it('renders the TopicsTable', () => {

0 commit comments

Comments
 (0)