From cfc6f98e77a5c30ef8751e5f502d4ea05306a79b Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Sat, 6 Apr 2024 08:19:18 -0400 Subject: [PATCH 1/2] feat(settings): display username on logout hover --- src/routes/Settings.test.tsx | 8 ++++---- src/routes/Settings.tsx | 8 ++++++-- src/routes/__snapshots__/Settings.test.tsx.snap | 5 +++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/routes/Settings.test.tsx b/src/routes/Settings.test.tsx index e8b608b9e..23e1f7d9a 100644 --- a/src/routes/Settings.test.tsx +++ b/src/routes/Settings.test.tsx @@ -47,10 +47,10 @@ describe('routes/Settings.tsx', () => { it('should press the logout', async () => { const logoutMock = jest.fn(); - let getByTitle; + let getByRole; await act(async () => { - const { getByTitle: getByLabelTextLocal } = render( + const { getByRole: getByRoleLocal } = render( { , ); - getByTitle = getByLabelTextLocal; + getByRole = getByRoleLocal; }); - fireEvent.click(getByTitle('Logout')); + fireEvent.click(getByRole('Logout')); expect(logoutMock).toHaveBeenCalledTimes(1); diff --git a/src/routes/Settings.tsx b/src/routes/Settings.tsx index 3017d2941..ec109c622 100644 --- a/src/routes/Settings.tsx +++ b/src/routes/Settings.tsx @@ -230,10 +230,14 @@ export const SettingsRoute: React.FC = () => { diff --git a/src/routes/__snapshots__/Settings.test.tsx.snap b/src/routes/__snapshots__/Settings.test.tsx.snap index 34cf42d08..f6916ff5a 100644 --- a/src/routes/__snapshots__/Settings.test.tsx.snap +++ b/src/routes/__snapshots__/Settings.test.tsx.snap @@ -420,7 +420,7 @@ exports[`routes/Settings.tsx should render itself & its children 1`] = ` type="button" >