From 4d0c61dca3c12035704ceddb937e65aa53636ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Tue, 9 Jul 2024 12:01:16 +0100 Subject: [PATCH] test: fix password reset email throttle test --- src/lib/services/user-service.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/services/user-service.test.ts b/src/lib/services/user-service.test.ts index 2884a11364bf..bb174e58b2ec 100644 --- a/src/lib/services/user-service.test.ts +++ b/src/lib/services/user-service.test.ts @@ -549,7 +549,9 @@ test('Should throttle password reset email', async () => { await expect(attempt1).resolves.toBeInstanceOf(URL); const attempt2 = service.createResetPasswordEmail('known@example.com'); - 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();