diff --git a/client/client/src/descriptor/descriptor.spec.js b/client/client/src/descriptor/descriptor.spec.js new file mode 100644 index 0000000000..d5bfa119a8 --- /dev/null +++ b/client/client/src/descriptor/descriptor.spec.js @@ -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); + }); + }); + }); +});