#6264 - renewToken #1824

Merged
jsegarra merged 36 commits from 6264-renewToken into dev 2023-12-20 09:22:29 +00:00
2 changed files with 31 additions and 0 deletions
Showing only changes of commit bcccd1894c - Show all commits

View File

@ -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');
});
});

View File

@ -0,0 +1,9 @@
describe('Validate Token', () => {
it('Token is not expired', async() => {
jsegarra marked this conversation as resolved Outdated
Outdated
Review

Vacios?

Vacios?
});
it('Token is expired', async() => {
});
});