import './index.js'; describe('ItemBotanical', () => { describe('Component vnItemBotanical', () => { let $httpBackend; let $scope; let controller; beforeEach(ngModule('item')); beforeEach(inject(($componentController, _$httpBackend_, $rootScope) => { $httpBackend = _$httpBackend_; $scope = $rootScope.$new(); const $element = angular.element(''); controller = $componentController('vnItemBotanical', {$element, $scope}); controller.$params = {id: 123}; })); describe('_getBotanical()', () => { it('should request to patch the propagation of botanical status', () => { $httpBackend.whenGET('ItemBotanicals?filter={"where":{"itemFk":123},"include":[{"relation":"genus"},{"relation":"specie"}]}').respond({data: 'item'}); $httpBackend.expectGET('ItemBotanicals?filter={"where":{"itemFk":123},"include":[{"relation":"genus"},{"relation":"specie"}]}'); controller.$onInit(); $httpBackend.flush(); }); }); }); });