unit tests for autocompelete showDropDown plus small correction in other two files.

This commit is contained in:
Carlos 2017-09-26 10:26:21 +02:00
parent bf0bd37773
commit b41f5a3996
3 changed files with 32 additions and 5 deletions

View File

@ -16,7 +16,7 @@ describe('Client', () => {
}));
it('should define and set address property', () => {
let controller = $componentController('vnAddressCreate', {$state: $state});
let controller = $componentController('vnAddressCreate', {$state});
expect(controller.address.clientFk).toBe(1234);
expect(controller.address.enabled).toBe(true);

View File

@ -58,7 +58,3 @@ ngModule.component('vnClientWebAccess', {
client: '<'
}
});
// el password no se puede cambiar por defecto
// testear isCustomer()

View File

@ -0,0 +1,31 @@
import './autocomplete.js';
describe('Component vnAutocomplete', () => {
let $componentController;
let $scope;
let $httpBackend;
let $timeout;
let $element;
beforeEach(() => {
angular.mock.module('client');
});
beforeEach(angular.mock.inject((_$componentController_, $rootScope, _$httpBackend_, _$timeout_) => {
$componentController = _$componentController_;
$scope = $rootScope.$new();
$httpBackend = _$httpBackend_;
$timeout = _$timeout_;
$element = angular.element('<div></div>');
}));
describe('showDropDown() setter', () => {
it(`should set _showDropDown value`, () => {
let controller = $componentController('vnAutocomplete', {$scope, $element, $httpBackend, $timeout});
controller._showDropDown = '';
controller.showDropDown = 'some value';
expect(controller._showDropDown).toEqual('some value');
});
});
});