Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
beckpaul committed Dec 3, 2023
1 parent 570a1d3 commit 83f0923
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/integration/accountRouter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ beforeEach(async () => {
describe('Account Routes', function () {
const publicUrls = [
'/account/requestPasswordReset',
'/account/password/confirmReset',
'/account/register',
'/account/activate'
]
Expand All @@ -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')

Check failure on line 25 in tests/integration/accountRouter.test.js

View workflow job for this annotation

GitHub Actions / checks

Expected indentation of 8 spaces but found 6
expect(response.statusCode).toBe(200)

Check failure on line 26 in tests/integration/accountRouter.test.js

View workflow job for this annotation

GitHub Actions / checks

Expected indentation of 8 spaces but found 6
expect(response.headers.location).toBe('/account/requestPasswordReset')

Check failure on line 27 in tests/integration/accountRouter.test.js

View workflow job for this annotation

GitHub Actions / checks

Expected indentation of 8 spaces but found 6
})

test('redirect to reset request page if missing parameters', async () => {
const response = await testSession.get('/account/password/confirmReset')

Check failure on line 31 in tests/integration/accountRouter.test.js

View workflow job for this annotation

GitHub Actions / checks

Expected indentation of 8 spaces but found 6
expect(response.statusCode).toBe(200)

Check failure on line 32 in tests/integration/accountRouter.test.js

View workflow job for this annotation

GitHub Actions / checks

Expected indentation of 8 spaces but found 6
expect(response.headers.location).toBe('/account/requestPasswordReset')

Check failure on line 33 in tests/integration/accountRouter.test.js

View workflow job for this annotation

GitHub Actions / checks

Expected indentation of 8 spaces but found 6
})

test('redirect old pw-reset routes', async () => {
const response = await testSession.get('/account/password/reset')
expect(response.statusCode).toBe(302)
Expand Down

0 comments on commit 83f0923

Please sign in to comment.