diff options
Diffstat (limited to 'web-ui/test')
-rw-r--r-- | web-ui/test/spec/search/results_highlighter.spec.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/web-ui/test/spec/search/results_highlighter.spec.js b/web-ui/test/spec/search/results_highlighter.spec.js index 117f4cfd..dde92ffc 100644 --- a/web-ui/test/spec/search/results_highlighter.spec.js +++ b/web-ui/test/spec/search/results_highlighter.spec.js @@ -12,4 +12,15 @@ describeComponent('search/results_highlighter', function () { expect(highlightedWords).toEqual(1); }); + it('resets highlights when a new search is performed', function() { + this.setupComponent('<div id="text">Any one seeing too many open bugs</div>'); + + this.component.attr = {keywords: ["any"]}; + this.component.highlightResults(event, {where: '#text'}); + $(document).trigger(Pixelated.events.search.resetHighlight); + + var highlightedWords = this.component.$node.find('.search-highlight').length; + + expect(highlightedWords).toEqual(0); + }); }); |