item descriptor front test

This commit is contained in:
gerard 2018-08-09 16:12:28 +02:00
parent f0df298138
commit a58e534a6d
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
import './index.js';
describe('Item', () => {
describe('Component vnItemDescriptor', () => {
let $componentController;
let controller;
beforeEach(() => {
angular.mock.module('item');
});
beforeEach(angular.mock.inject(_$componentController_ => {
$componentController = _$componentController_;
controller = $componentController('vnItemDescriptor');
controller.$state.go = () => {};
}));
describe('quicklinkGo()', () => {
it(`shoud set _itemFk to a given value and call _getItem if the given value is not null`, () => {
spyOn(controller.$state, 'go');
controller.quicklinkGo('state', 'params');
expect(controller.$state.go).toHaveBeenCalledWith('state', 'params');
});
});
});
});