5554-renovar_token #1566

Merged
vicent merged 24 commits from 5554-renovar_token into dev 2023-06-20 12:38:47 +00:00
1 changed files with 4 additions and 7 deletions
Showing only changes of commit 5d3ecfa00e - Show all commits

View File

@ -49,18 +49,15 @@ describe('Component vnLayout', () => {
controller.getAccessTokenConfig();
$httpBackend.flush();
const renewPeriod = localStorage.getItem('renewPeriod');
const renewInterval = localStorage.getItem('renewInterval');
expect(renewPeriod).toBe('100');
expect(renewInterval).toBe('5');
expect(controller.renewPeriod).toBe(100);
expect(controller.renewInterval).toBe(5);
expect(controller.inservalId).toBeDefined();
});
});
describe('checkTokenValidity()', () => {
it(`should not call renewToken and not set vnToken in the controller`, () => {
localStorage.setItem('renewPeriod', 100);
controller.renewPeriod = 100;
controller.vnToken.created = new Date();
controller.checkTokenValidity();
@ -73,7 +70,7 @@ describe('Component vnLayout', () => {
token: 999,
created: new Date()
};
localStorage.setItem('renewPeriod', 100);
controller.renewPeriod = 100;
const oneHourBefore = new Date(Date.now() - (60 * 60 * 1000));
controller.vnToken.created = oneHourBefore;