From b013538b63426ecad2c522051ebc594b416830f5 Mon Sep 17 00:00:00 2001 From: kikootwo Date: Tue, 10 Feb 2026 22:12:06 -0500 Subject: [PATCH] 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()). --- tests/components/ui/ChangePasswordModal.test.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/components/ui/ChangePasswordModal.test.tsx b/tests/components/ui/ChangePasswordModal.test.tsx index 598b03e..981341e 100644 --- a/tests/components/ui/ChangePasswordModal.test.tsx +++ b/tests/components/ui/ChangePasswordModal.test.tsx @@ -48,7 +48,10 @@ describe('ChangePasswordModal', () => { 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 () => {