descriptor unit test
This commit is contained in:
parent
352e68ed58
commit
e43e3211d0
|
@ -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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue