From c93d3f884687449ff623888cb9c392a022293c7c Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 8 Mar 2023 07:47:25 +0100 Subject: [PATCH] Updated front unit test --- modules/claim/front/detail/index.spec.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/claim/front/detail/index.spec.js b/modules/claim/front/detail/index.spec.js index a2b177281..8f3049339 100644 --- a/modules/claim/front/detail/index.spec.js +++ b/modules/claim/front/detail/index.spec.js @@ -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();