From ba813834f6e59cf2e909e332a6b49a15b77a8b20 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 28 May 2024 20:32:49 -0400 Subject: [PATCH] test(settings): add account hostname test --- src/routes/Settings.test.tsx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/routes/Settings.test.tsx b/src/routes/Settings.test.tsx index ce3d69a51..1060e9adc 100644 --- a/src/routes/Settings.test.tsx +++ b/src/routes/Settings.test.tsx @@ -106,6 +106,31 @@ describe('routes/Settings.tsx', () => { false, ); }); + + it('should toggle account hostname checkbox', async () => { + await act(async () => { + render( + + + + + , + ); + }); + + 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', () => {