2018-05-25 08:03:45 +00:00
|
|
|
import './index.js';
|
2018-02-21 12:10:23 +00:00
|
|
|
|
|
|
|
describe('ItemBotanical', () => {
|
|
|
|
describe('Component vnItemBotanical', () => {
|
|
|
|
let $httpBackend;
|
2020-03-17 13:43:46 +00:00
|
|
|
let $scope;
|
2018-02-21 12:10:23 +00:00
|
|
|
let controller;
|
|
|
|
|
2019-10-24 22:53:53 +00:00
|
|
|
beforeEach(ngModule('item'));
|
2018-02-21 12:10:23 +00:00
|
|
|
|
2020-07-23 14:46:16 +00:00
|
|
|
beforeEach(inject(($componentController, _$httpBackend_, $rootScope) => {
|
2018-02-21 12:10:23 +00:00
|
|
|
$httpBackend = _$httpBackend_;
|
2020-03-17 13:43:46 +00:00
|
|
|
$scope = $rootScope.$new();
|
|
|
|
const $element = angular.element('<vn-item-botanical></vn-item-botanical>');
|
|
|
|
controller = $componentController('vnItemBotanical', {$element, $scope});
|
|
|
|
controller.$params = {id: 123};
|
2018-02-21 12:10:23 +00:00
|
|
|
}));
|
|
|
|
|
|
|
|
describe('_getBotanical()', () => {
|
|
|
|
it('should request to patch the propagation of botanical status', () => {
|
2019-10-24 22:53:53 +00:00
|
|
|
$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"}]}');
|
2018-02-21 12:10:23 +00:00
|
|
|
controller.$onInit();
|
|
|
|
$httpBackend.flush();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|