Skip to content

Commit 3eb62f5

Browse files
committed
test(web): remove password reset redirection test and update status check
1 parent af3e09b commit 3eb62f5

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

__tests__/routes/web/index.spec.js

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ const createHttpError = require('http-errors');
33
const app = require('@exzly-routes');
44
const webErrorHandler = require('@exzly-routes/web/error');
55
const { createRoute } = require('@exzly-utils');
6-
const { AuthVerifyModel } = require('@exzly-models');
7-
const { SHA1 } = require('crypto-js');
86

97
let adminAuthCookie, memberAuthCookie;
108

@@ -50,26 +48,7 @@ describe('Web Routes', () => {
5048
.expect(400);
5149
});
5250

53-
it('test 7: should redirect to reset password page when accessing verification page with valid token', async () => {
54-
await request(app)
55-
.post(createRoute('api', '/auth/forgot-password'))
56-
.send({ identity: 'member' })
57-
.expect(200);
58-
59-
const authVerify = await AuthVerifyModel.findOne({
60-
where: { userId: 2 },
61-
order: [['createdAt', 'DESC']],
62-
});
63-
const token = SHA1(authVerify.code).toString();
64-
const response = await request(app)
65-
.get(createRoute('web', 'verification'))
66-
.query({ token })
67-
.expect(302);
68-
69-
expect(response.header.location).toBe(createRoute('web', '/reset-password'));
70-
});
71-
72-
it('test 8: should return 200 when accessing test page', async () => {
51+
it('test 7: should return 200 when accessing test page', async () => {
7352
await request(app).get(createRoute('web', '/test')).query({ a: 1, b: 2, c: 3 }).expect(200);
7453
});
7554
});

0 commit comments

Comments
 (0)