Skip to content

Commit c5447fb

Browse files
authored
test(settings): add account hostname test (#1152)
1 parent b18584b commit c5447fb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/routes/Settings.test.tsx

+25
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,31 @@ describe('routes/Settings.tsx', () => {
106106
false,
107107
);
108108
});
109+
110+
it('should toggle account hostname checkbox', async () => {
111+
await act(async () => {
112+
render(
113+
<AppContext.Provider
114+
value={{
115+
settings: mockSettings,
116+
auth: mockAuth,
117+
updateSetting,
118+
}}
119+
>
120+
<MemoryRouter>
121+
<SettingsRoute />
122+
</MemoryRouter>
123+
</AppContext.Provider>,
124+
);
125+
});
126+
127+
await screen.findByLabelText('Show account hostname');
128+
129+
fireEvent.click(screen.getByLabelText('Show account hostname'));
130+
131+
expect(updateSetting).toHaveBeenCalledTimes(1);
132+
expect(updateSetting).toHaveBeenCalledWith('showAccountHostname', true);
133+
});
109134
});
110135

111136
describe('Notifications section', () => {

0 commit comments

Comments
 (0)