test(worker_time-control): tested url parameter timestamp
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
07e092f9bd
commit
85e3b47408
|
@ -27,7 +27,7 @@ export async function getBrowser() {
|
||||||
args,
|
args,
|
||||||
defaultViewport: null,
|
defaultViewport: null,
|
||||||
headless: headless,
|
headless: headless,
|
||||||
slowMo: 5, // slow down by ms
|
slowMo: 1, // slow down by ms
|
||||||
// ignoreDefaultArgs: ['--disable-extensions'],
|
// ignoreDefaultArgs: ['--disable-extensions'],
|
||||||
// executablePath: '/usr/bin/google-chrome-stable',
|
// executablePath: '/usr/bin/google-chrome-stable',
|
||||||
// executablePath: '/usr/bin/firefox-developer-edition',
|
// executablePath: '/usr/bin/firefox-developer-edition',
|
||||||
|
|
|
@ -129,5 +129,28 @@ describe('Component vnWorkerTimeControl', () => {
|
||||||
expect(controller.fetchHours).toHaveBeenCalledWith();
|
expect(controller.fetchHours).toHaveBeenCalledWith();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('$postLink() ', () => {
|
||||||
|
it(`should set the controller date as today if no timestamp is defined`, () => {
|
||||||
|
controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())};
|
||||||
|
controller.$params = {timestamp: undefined};
|
||||||
|
controller.$postLink();
|
||||||
|
|
||||||
|
expect(controller.date).toEqual(jasmine.any(Date));
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should set the controller date using the received timestamp`, () => {
|
||||||
|
const date = 'Wed, 31 Dec 1969 23:00:00 GMT';
|
||||||
|
const timestamp = 1;
|
||||||
|
|
||||||
|
controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())};
|
||||||
|
controller.$.calendar = {};
|
||||||
|
controller.$params = {timestamp: timestamp};
|
||||||
|
|
||||||
|
controller.$postLink();
|
||||||
|
|
||||||
|
expect(controller.date.toUTCString()).toEqual(date);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue