diff --git a/client/item/src/card/item-card.spec.js b/client/item/src/card/item-card.spec.js index 72e09a306..47a1cd28c 100644 --- a/client/item/src/card/item-card.spec.js +++ b/client/item/src/card/item-card.spec.js @@ -18,15 +18,13 @@ describe('Item', () => { controller = $componentController('vnItemCard', {$state: $state}); })); - describe('$onInit()', () => { + describe('_getBasicData()', () => { it('should request to patch the propagation of tax status', () => { - controller.client = {id: 123, isEqualizated: false}; - $httpBackend.whenGET('/item/api/Items/undefined?filter={"include":[{"relation":"itemType"},{"relation":"origin"},{"relation":"ink"},{"relation":"producer"},{"relation":"intrastat"},{"relation":"expence"},{"relation":"itemTag","scope":{"order":"priority ASC","include":{"relation":"tag"}}}]}').respond({data: 'item'}); - $httpBackend.expectGET('/item/api/Items/undefined?filter={"include":[{"relation":"itemType"},{"relation":"origin"},{"relation":"ink"},{"relation":"producer"},{"relation":"intrastat"},{"relation":"expence"},{"relation":"itemTag","scope":{"order":"priority ASC","include":{"relation":"tag"}}}]}'); - controller.$onInit(); + controller.item = {id: 123}; + $httpBackend.whenGET('/item/api/Items/123?filter={"include":[{"relation":"itemType"},{"relation":"origin"},{"relation":"ink"},{"relation":"producer"},{"relation":"intrastat"},{"relation":"expence"},{"relation":"itemTag","scope":{"order":"priority ASC","include":{"relation":"tag"}}}]}').respond({data: 'item'}); + $httpBackend.expectGET('/item/api/Items/123?filter={"include":[{"relation":"itemType"},{"relation":"origin"},{"relation":"ink"},{"relation":"producer"},{"relation":"intrastat"},{"relation":"expence"},{"relation":"itemTag","scope":{"order":"priority ASC","include":{"relation":"tag"}}}]}'); + controller._getBasicData(); $httpBackend.flush(); - - expect(controller.item).toEqual({data: 'item'}); }); }); });