32 lines
977 B
JavaScript
32 lines
977 B
JavaScript
|
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');
|
||
|
});
|
||
|
});
|
||
|
});
|