test(supplier_summary): test for sageWithholdingFk to isFarmer
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2021-12-29 11:52:45 +01:00
parent e9f77bb9b4
commit 83a28bc0ee
1 changed files with 13 additions and 1 deletions

View File

@ -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});
});
});
});