Skip to content

Commit

Permalink
Merge pull request #22 from plumelo/feature/NEOV-180-suggestions-not-…
Browse files Browse the repository at this point in the history
…rerendered

When source changed update suggestions list.
  • Loading branch information
nomego authored Apr 17, 2018
2 parents 2ca8153 + a9d1f7e commit a63f918
Show file tree
Hide file tree
Showing 3 changed files with 306 additions and 160 deletions.
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"cosmoz-omnitable": "Neovici/cosmoz-omnitable#^1.0.0",
"cosmoz-tree": "Neovici/cosmoz-tree#^1.0.0",
"cosmoz-treenode": "Neovici/cosmoz-treenode#^1.0.0",
"paper-autocomplete": "ellipticaljs/paper-autocomplete#^3.6.0",
"paper-autocomplete": "ellipticaljs/paper-autocomplete#^3.7.0",
"paper-spinner": "PolymerElements/paper-spinner#1 - 2"
},
"devDependencies": {
Expand All @@ -28,7 +28,7 @@
"cosmoz-omnitable": "Neovici/cosmoz-omnitable#^1.0.0",
"cosmoz-tree": "Neovici/cosmoz-tree#^1.0.0",
"cosmoz-treenode": "Neovici/cosmoz-treenode#^1.0.0",
"paper-autocomplete": "ellipticaljs/paper-autocomplete#^3.6.0",
"paper-autocomplete": "ellipticaljs/paper-autocomplete#^3.7.0",
"paper-spinner": "PolymerElements/paper-spinner#1 - 2"
},
"devDependencies": {
Expand Down
25 changes: 25 additions & 0 deletions test/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,31 @@
done();
}, 300);
});

test('suggestions are updated when input is focused if values are changed', done => {
const suggestions = paperAutocomplete.$.paperAutocompleteSuggestions,
input = paperAutocomplete.$.autocompleteInput;

paperAutocomplete.text = 'Uzw';
input.fire('focus', {});
omnitable.data = [
{
name: 'bbb',
nodeId: '3a7654f1-e3e6-49c7-b6a8-a4fb00f31245'
},
{
name: 'ccc',
nodeId: '426d7dba-a4f0-4bd4-9b34-a4fb00f31248'
}];
omnitable.notifyResize();

Polymer.Base.async(() => {
console.log(paperAutocomplete);
assert.isTrue(suggestions.isOpen);
assert.equal(suggestions._suggestions.length, 1);
done();
}, 300);
});
});
})();
</script>
Expand Down
Loading

0 comments on commit a63f918

Please sign in to comment.