diff --git a/modules/supplier/front/summary/index.spec.js b/modules/supplier/front/summary/index.spec.js index aa44cd14f..a1e418670 100644 --- a/modules/supplier/front/summary/index.spec.js +++ b/modules/supplier/front/summary/index.spec.js @@ -25,7 +25,19 @@ describe('Supplier', () => { controller.getSummary(); $httpBackend.flush(); - expect(controller.summary).toEqual({id: 1}); + expect(controller.summary).toEqual({id: 1, isFarmer: false}); + }); + + it('should get if supplier is farmer by sageWithholdingFk', () => { + controller.supplier = {id: 2}; + + const query = `Suppliers/${controller.supplier.id}/getSummary`; + + $httpBackend.expectGET(query).respond({id: 2, sageWithholdingFk: 2}); + controller.getSummary(); + $httpBackend.flush(); + + expect(controller.summary).toEqual({id: 2, isFarmer: true, sageWithholdingFk: 2}); }); }); });