From 1d03082ca064744116ac625766aeac4b41ff82f7 Mon Sep 17 00:00:00 2001 From: Lisa Junger Date: Wed, 25 Mar 2015 11:49:49 +0100 Subject: Resets highlighting on search_trigger. -Issue #291. --- web-ui/test/spec/search/results_highlighter.spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'web-ui/test/spec') 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('
Any one seeing too many open bugs
'); + + 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); + }); }); -- cgit v1.2.3