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 $componentController;
|
|
|
|
let $httpBackend;
|
|
|
|
let $state;
|
|
|
|
let controller;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
angular.mock.module('item');
|
|
|
|
});
|
|
|
|
|
|
|
|
beforeEach(angular.mock.inject((_$componentController_, _$state_, _$httpBackend_) => {
|
|
|
|
$componentController = _$componentController_;
|
|
|
|
$httpBackend = _$httpBackend_;
|
2018-05-25 15:25:35 +00:00
|
|
|
$httpBackend.when('GET', /\/locale\/\w+\/[a-z]{2}\.json/).respond({});
|
2018-02-21 12:10:23 +00:00
|
|
|
$state = {
|
|
|
|
params: {
|
|
|
|
id: 123
|
|
|
|
}
|
|
|
|
};
|
|
|
|
controller = $componentController('vnItemBotanical', {$state: $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();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|