From 83f0923156701a834907579dcebc8fbf12a86de5 Mon Sep 17 00:00:00 2001 From: beckpaul Date: Sat, 2 Dec 2023 21:27:59 -0500 Subject: [PATCH] update unit tests --- tests/integration/accountRouter.test.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/integration/accountRouter.test.js b/tests/integration/accountRouter.test.js index 2097a11d..907b8c16 100644 --- a/tests/integration/accountRouter.test.js +++ b/tests/integration/accountRouter.test.js @@ -12,7 +12,6 @@ beforeEach(async () => { describe('Account Routes', function () { const publicUrls = [ '/account/requestPasswordReset', - '/account/password/confirmReset', '/account/register', '/account/activate' ] @@ -22,6 +21,18 @@ describe('Account Routes', function () { expect(res.statusCode).toBe(200) }) + test('responds with OK to provided parameters', async () => { + const response = await testSession.get('/account/password/confirmReset?username=turbo2&token=XXXXX') + expect(response.statusCode).toBe(200) + expect(response.headers.location).toBe('/account/requestPasswordReset') + }) + + test('redirect to reset request page if missing parameters', async () => { + const response = await testSession.get('/account/password/confirmReset') + expect(response.statusCode).toBe(200) + expect(response.headers.location).toBe('/account/requestPasswordReset') + }) + test('redirect old pw-reset routes', async () => { const response = await testSession.get('/account/password/reset') expect(response.statusCode).toBe(302)