note-create unit test

This commit is contained in:
Carlos 2017-09-01 09:20:22 +02:00
parent abe576078e
commit fd39993794
2 changed files with 22 additions and 1 deletions

View File

@ -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({});
});

View File

@ -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);
});
});