2018-05-23 12:26:51 +00:00
|
|
|
import './index';
|
2017-09-01 07:20:22 +00:00
|
|
|
|
2017-09-04 13:06:43 +00:00
|
|
|
describe('Client', () => {
|
|
|
|
describe('Component vnNoteCreate', () => {
|
|
|
|
let $state;
|
2017-10-17 12:24:40 +00:00
|
|
|
let controller;
|
2017-09-01 07:20:22 +00:00
|
|
|
|
2019-10-24 22:53:53 +00:00
|
|
|
beforeEach(ngModule('client'));
|
2017-09-01 07:20:22 +00:00
|
|
|
|
2020-03-20 11:00:53 +00:00
|
|
|
beforeEach(angular.mock.inject(($componentController, _$state_) => {
|
2017-09-04 13:06:43 +00:00
|
|
|
$state = _$state_;
|
|
|
|
$state.params.id = '1234';
|
2020-03-20 11:00:53 +00:00
|
|
|
const $element = angular.element('<vn-note-create></vn-note-create>');
|
|
|
|
controller = $componentController('vnNoteCreate', {$element, $state});
|
2017-09-04 13:06:43 +00:00
|
|
|
}));
|
2017-09-01 07:20:22 +00:00
|
|
|
|
2017-09-04 13:06:43 +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
|
|
|
});
|
|
|
|
});
|