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