descriptor unit test

This commit is contained in:
Carlos 2017-09-04 17:15:07 +02:00
parent 352e68ed58
commit e43e3211d0
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
import './descriptor.js';
describe('Client', () => {
describe('Component vnDescriptor', () => {
let $componentController;
let $scope;
beforeEach(() => {
angular.mock.module('client');
});
beforeEach(angular.mock.inject((_$componentController_, $rootScope) => {
$componentController = _$componentController_;
$scope = $rootScope.$new();
}));
describe('set active', () => {
it('should check if active is defined and diferent from the new value', () => {
let controller = $componentController('vnDescriptor', {$scope: $scope});
controller.client = {id: 1};
expect(controller._active).toBe(undefined);
controller.active = false;
expect(controller._active).toBe(false);
controller.active = true;
expect(controller._active).toBe(true);
});
});
});
});