Skip to content

Commit

Permalink
test: fix password reset email throttle test
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois committed Jul 9, 2024
1 parent 196dab7 commit 4d0c61d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/services/user-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,9 @@ test('Should throttle password reset email', async () => {
await expect(attempt1).resolves.toBeInstanceOf(URL);

const attempt2 = service.createResetPasswordEmail('[email protected]');
await expect(attempt2).resolves.toBe(undefined);
await expect(attempt2).rejects.toThrow(
'You can only send one new reset password email per minute, per user. Please try again later.',
);

jest.runAllTimers();

Expand Down

0 comments on commit 4d0c61d

Please sign in to comment.