Bug #312 Autocomplete intenta mostrar el valor antes de tener los datos
This commit is contained in:
parent
c123207ac2
commit
3bca15708f
|
@ -31,6 +31,15 @@ export default class Autocomplete extends Input {
|
|||
this.element.querySelector('.mdl-textfield'));
|
||||
}
|
||||
|
||||
set url(value) {
|
||||
this._url = value;
|
||||
this.refreshSelection();
|
||||
}
|
||||
|
||||
get url() {
|
||||
return this._url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {any} The autocomplete value.
|
||||
*/
|
||||
|
|
|
@ -21,6 +21,16 @@ describe('Component vnAutocomplete', () => {
|
|||
controller = _$componentController_('vnAutocomplete', {$element, $scope, $httpBackend, $transclude: null});
|
||||
}));
|
||||
|
||||
describe('url() setter', () => {
|
||||
it(`should set url controllers property and call refreshSelection`, () => {
|
||||
spyOn(controller, "refreshSelection");
|
||||
controller.url = "url";
|
||||
|
||||
expect(controller.url).toEqual("url");
|
||||
expect(controller.refreshSelection).toHaveBeenCalledWith();
|
||||
});
|
||||
});
|
||||
|
||||
describe('field() setter/getter', () => {
|
||||
it(`should set field controllers property`, () => {
|
||||
controller.field = data.id;
|
||||
|
|
Loading…
Reference in New Issue