2018-02-05 15:53:41 +00:00
|
|
|
import './item-card.js';
|
|
|
|
|
|
|
|
describe('Item', () => {
|
|
|
|
describe('Component vnItemCard', () => {
|
|
|
|
let $componentController;
|
|
|
|
let $httpBackend;
|
|
|
|
let $state;
|
|
|
|
let controller;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
angular.mock.module('item');
|
|
|
|
});
|
|
|
|
|
|
|
|
beforeEach(angular.mock.inject((_$componentController_, _$state_, _$httpBackend_) => {
|
|
|
|
$componentController = _$componentController_;
|
|
|
|
$httpBackend = _$httpBackend_;
|
|
|
|
$state = _$state_;
|
|
|
|
controller = $componentController('vnItemCard', {$state: $state});
|
|
|
|
}));
|
|
|
|
|
2018-02-20 11:58:00 +00:00
|
|
|
describe('_getBasicData()', () => {
|
2018-02-05 15:53:41 +00:00
|
|
|
it('should request to patch the propagation of tax status', () => {
|
2018-02-20 11:58:00 +00:00
|
|
|
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();
|
2018-02-05 15:53:41 +00:00
|
|
|
$httpBackend.flush();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|