unit tests for autocompelete showDropDown plus small correction in other two files.
This commit is contained in:
parent
bf0bd37773
commit
b41f5a3996
|
@ -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);
|
||||
|
|
|
@ -58,7 +58,3 @@ ngModule.component('vnClientWebAccess', {
|
|||
client: '<'
|
||||
}
|
||||
});
|
||||
|
||||
// el password no se puede cambiar por defecto
|
||||
|
||||
// testear isCustomer()
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue