mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 21:00:09 +00:00
Tighten fetch assertion in change password test
Replace a broad fetch mock expectation with a more specific one to ensure the test only asserts that the change-password endpoint was not called. This avoids false failures when other fetch calls occur by checking not.toHaveBeenCalledWith('/api/auth/change-password', expect.anything()).
This commit is contained in:
@@ -48,7 +48,10 @@ describe('ChangePasswordModal', () => {
|
|||||||
expect(screen.getByText('Not authenticated')).toBeInTheDocument();
|
expect(screen.getByText('Not authenticated')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fetchMock).not.toHaveBeenCalled();
|
expect(fetchMock).not.toHaveBeenCalledWith(
|
||||||
|
'/api/auth/change-password',
|
||||||
|
expect.anything()
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('submits successfully and auto-closes after showing success', async () => {
|
it('submits successfully and auto-closes after showing success', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user