Removed duplicated test
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2020-07-16 11:59:16 +02:00
parent 87fa66fe8c
commit cbb2ad7f44
1 changed files with 5 additions and 16 deletions

View File

@ -22,20 +22,6 @@ describe('Worker', () => {
controller._worker = {id: 106};
}));
describe('worker() setter', () => {
it(`should set the data an then call the refresh() and getIsSubordinate() methods`, () => {
jest.spyOn(controller, 'refresh').mockReturnValue(new Promise(resolve => {
return resolve();
}));
jest.spyOn(controller, 'getIsSubordinate').mockReturnValue(true);
controller.worker = {id: 107};
expect(controller.refresh).toHaveBeenCalledWith();
expect(controller.getIsSubordinate).toHaveBeenCalledWith();
});
});
describe('started property', () => {
it(`should return first day and month of current year`, () => {
let started = new Date(year, 0, 1);
@ -64,7 +50,10 @@ describe('Worker', () => {
describe('worker() setter', () => {
it(`should perform a get query and set the reponse data on the model`, () => {
jest.spyOn(controller, 'getIsSubordinate').mockReturnThis();
jest.spyOn(controller, 'getIsSubordinate').mockReturnValue(true);
jest.spyOn(controller, 'refresh').mockReturnValue(new Promise(resolve => {
return resolve();
}));
let today = new Date();
@ -86,7 +75,7 @@ describe('Worker', () => {
]
});
controller.worker = {id: 1};
controller.worker = {id: 107};
$httpBackend.flush();
let events = controller.events;