salix/modules/client/front/note/create/index.spec.js

23 lines
715 B
JavaScript

import './index';
describe('Client', () => {
describe('Component vnNoteCreate', () => {
let $state;
let controller;
beforeEach(ngModule('client'));
beforeEach(angular.mock.inject(($componentController, _$state_) => {
$state = _$state_;
$state.params.id = '1234';
const $element = angular.element('<vn-note-create></vn-note-create>');
controller = $componentController('vnNoteCreate', {$element, $state});
}));
it('should define clientFk using $state.params.id', () => {
expect(controller.note.clientFk).toBe(1234);
expect(controller.note.client).toBe(undefined);
});
});
});