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)