client unit test for autocomplete displayValue(), some functionality remains wild i.e. item.checked = false;
This commit is contained in:
parent
b41f5a3996
commit
3a666ef764
|
@ -27,5 +27,34 @@ describe('Component vnAutocomplete', () => {
|
|||
|
||||
expect(controller._showDropDown).toEqual('some value');
|
||||
});
|
||||
|
||||
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');
|
||||
});
|
||||
});
|
||||
|
||||
describe('displayValue() setter', () => {
|
||||
it(`should display value in a formated way`, () => {
|
||||
let controller = $componentController('vnAutocomplete', {$scope, $element, $httpBackend, $timeout});
|
||||
let value = 'some value';
|
||||
controller.displayValue = value;
|
||||
|
||||
expect(controller._value).toEqual(value);
|
||||
});
|
||||
|
||||
describe('when the autocomeplete is multiple', () => {
|
||||
it(`should display values separated with commas`, () => {
|
||||
let controller = $componentController('vnAutocomplete', {$scope, $element, $httpBackend, $timeout});
|
||||
controller.multiple = true;
|
||||
controller.displayValue = 'some value';
|
||||
controller.displayValue = 'another value';
|
||||
|
||||
expect(controller._value).toEqual('some value, another value');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue