Skip to content

Commit

Permalink
test: fix account settings test
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy committed Jun 6, 2024
1 parent 7d16d3d commit da438f8
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/routes/Settings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -503,19 +503,22 @@ describe('routes/Settings.tsx', () => {
);
});

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

fireEvent.click(screen.getByTitle('Accounts'));
expect(mockNavigate).toHaveBeenCalledWith('/accounts');
});
Expand Down

0 comments on commit da438f8

Please sign in to comment.