@@ -3,8 +3,6 @@ const createHttpError = require('http-errors');
33const app = require ( '@exzly-routes' ) ;
44const webErrorHandler = require ( '@exzly-routes/web/error' ) ;
55const { createRoute } = require ( '@exzly-utils' ) ;
6- const { AuthVerifyModel } = require ( '@exzly-models' ) ;
7- const { SHA1 } = require ( 'crypto-js' ) ;
86
97let 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