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