Updated unit test
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-03-02 07:57:33 +01:00
parent 28553a1c0d
commit 03e952c83e
1 changed files with 4 additions and 4 deletions

View File

@ -22,15 +22,15 @@ describe('Worker', () => {
describe('deleteDms()', () => {
it('should make an HTTP Post query', () => {
const dmsId = 4;
const workerDmsId = 1;
const dmsIndex = 0;
jest.spyOn(controller.vnApp, 'showSuccess');
jest.spyOn(controller.$.model, 'remove');
controller.workerDms = [{dmsFk: 4}];
controller.workerDms = [{id: 1, dmsFk: 4}];
controller.dmsIndex = dmsIndex;
$httpBackend.when('POST', `WorkerDms/${dmsId}/removeFile`).respond({});
$httpBackend.expect('POST', `WorkerDms/${dmsId}/removeFile`);
$httpBackend.when('POST', `WorkerDms/${workerDmsId}/removeFile`).respond({});
$httpBackend.expect('POST', `WorkerDms/${workerDmsId}/removeFile`);
controller.deleteDms('accept');
$httpBackend.flush();