Skip to content

Commit

Permalink
test(settings): add account hostname test (#1152)
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy authored May 29, 2024
1 parent b18584b commit c5447fb
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/routes/Settings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,31 @@ describe('routes/Settings.tsx', () => {
false,
);
});

it('should toggle account hostname checkbox', async () => {
await act(async () => {
render(
<AppContext.Provider
value={{
settings: mockSettings,
auth: mockAuth,
updateSetting,
}}
>
<MemoryRouter>
<SettingsRoute />
</MemoryRouter>
</AppContext.Provider>,
);
});

await screen.findByLabelText('Show account hostname');

fireEvent.click(screen.getByLabelText('Show account hostname'));

expect(updateSetting).toHaveBeenCalledTimes(1);
expect(updateSetting).toHaveBeenCalledWith('showAccountHostname', true);
});
});

describe('Notifications section', () => {
Expand Down

0 comments on commit c5447fb

Please sign in to comment.