Updated unit test
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
28553a1c0d
commit
03e952c83e
|
@ -22,15 +22,15 @@ describe('Worker', () => {
|
||||||
|
|
||||||
describe('deleteDms()', () => {
|
describe('deleteDms()', () => {
|
||||||
it('should make an HTTP Post query', () => {
|
it('should make an HTTP Post query', () => {
|
||||||
const dmsId = 4;
|
const workerDmsId = 1;
|
||||||
const dmsIndex = 0;
|
const dmsIndex = 0;
|
||||||
jest.spyOn(controller.vnApp, 'showSuccess');
|
jest.spyOn(controller.vnApp, 'showSuccess');
|
||||||
jest.spyOn(controller.$.model, 'remove');
|
jest.spyOn(controller.$.model, 'remove');
|
||||||
controller.workerDms = [{dmsFk: 4}];
|
controller.workerDms = [{id: 1, dmsFk: 4}];
|
||||||
controller.dmsIndex = dmsIndex;
|
controller.dmsIndex = dmsIndex;
|
||||||
|
|
||||||
$httpBackend.when('POST', `WorkerDms/${dmsId}/removeFile`).respond({});
|
$httpBackend.when('POST', `WorkerDms/${workerDmsId}/removeFile`).respond({});
|
||||||
$httpBackend.expect('POST', `WorkerDms/${dmsId}/removeFile`);
|
$httpBackend.expect('POST', `WorkerDms/${workerDmsId}/removeFile`);
|
||||||
controller.deleteDms('accept');
|
controller.deleteDms('accept');
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue