5554-renovar_token #1566
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue