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

26 lines
826 B
JavaScript
Raw Normal View History

2018-05-23 12:26:51 +00:00
import './index';
2017-09-01 07:20:22 +00:00
describe('Client', () => {
describe('Component vnNoteCreate', () => {
let $componentController;
let $state;
let controller;
2017-09-01 07:20:22 +00:00
2019-09-13 14:09:14 +00:00
beforeEach(angular.mock.module('client', $translateProvider => {
$translateProvider.translations('en', {});
}));
2017-09-01 07:20:22 +00:00
beforeEach(angular.mock.inject((_$componentController_, _$state_) => {
$componentController = _$componentController_;
$state = _$state_;
$state.params.id = '1234';
controller = $componentController('vnNoteCreate', {$state: $state});
}));
2017-09-01 07:20:22 +00:00
it('should define clientFk using $state.params.id', () => {
expect(controller.note.clientFk).toBe(1234);
expect(controller.note.client).toBe(undefined);
});
2017-09-01 07:20:22 +00:00
});
});