note-create unit test
This commit is contained in:
parent
abe576078e
commit
fd39993794
|
@ -13,7 +13,6 @@ describe('Component vnClientIndex', () => {
|
|||
|
||||
it('should define and set model property as an empty object', () => {
|
||||
let controller = $componentController('vnClientIndex');
|
||||
expect(controller.model).toBeDefined();
|
||||
expect(controller.model).toEqual({});
|
||||
});
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
import './note-create.js';
|
||||
|
||||
describe('Component vnNoteCreate', () => {
|
||||
let $componentController;
|
||||
let $state;
|
||||
|
||||
beforeEach(() => {
|
||||
angular.mock.module('client');
|
||||
});
|
||||
|
||||
beforeEach(angular.mock.inject(function(_$componentController_, _$state_) {
|
||||
$componentController = _$componentController_;
|
||||
$state = _$state_;
|
||||
$state.params.id = '1234';
|
||||
}));
|
||||
|
||||
it('should define clientFk using $state.params.id', () => {
|
||||
let controller = $componentController('vnNoteCreate', {$state: $state});
|
||||
expect(controller.note.clientFk).toBe(1234);
|
||||
expect(controller.note.client).toBe(undefined);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue