refs #6264 test: init test
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
784f5bb7f9
commit
bcccd1894c
|
@ -0,0 +1,22 @@
|
|||
describe('Renew Token', () => {
|
||||
it('Token is valid', async() => {
|
||||
let login = await VnUser.signIn(unauthCtx, 'salesAssistant', 'nightmare');
|
||||
let accessToken = await AccessToken.findById(login.token);
|
||||
let ctx = {req: {accessToken: accessToken}};
|
||||
|
||||
expect(login.token).toBeDefined();
|
||||
});
|
||||
|
||||
it('Token is is invalid', async() => {
|
||||
let error;
|
||||
try {
|
||||
await models.VnUser.validateCode('developer', '123456');
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
expect(error).toBeDefined();
|
||||
expect(error.statusCode).toBe(400);
|
||||
expect(error.message).toEqual('Invalid or expired verification code');
|
||||
});
|
||||
});
|
|
@ -0,0 +1,9 @@
|
|||
describe('Validate Token', () => {
|
||||
it('Token is not expired', async() => {
|
||||
|
||||
});
|
||||
|
||||
it('Token is expired', async() => {
|
||||
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue