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

This commit is contained in:
Joan Sanchez 2023-03-08 07:47:25 +01:00
parent bb691ccf1d
commit c93d3f8846
1 changed files with 5 additions and 2 deletions

View File

@ -89,9 +89,12 @@ describe('claim', () => {
describe('setClaimedQuantity(id, claimedQuantity)', () => {
it('should make a patch and call refresh and showSuccess', () => {
const id = 1;
const claimedQuantity = 1;
jest.spyOn(controller.vnApp, 'showSuccess');
$httpBackend.expectPATCH(`ClaimBeginnings/`).respond({});
controller.setClaimedQuantity(1, 1);
$httpBackend.expectPATCH(`ClaimBeginnings/${id}`).respond({});
controller.setClaimedQuantity(id, claimedQuantity);
$httpBackend.flush();
expect(controller.vnApp.showSuccess).toHaveBeenCalled();