summaryrefslogtreecommitdiff
path: root/web-ui/test
diff options
context:
space:
mode:
authorAlabĂȘ Duarte <aduarte@thoughtworks.com>2015-02-24 00:36:07 -0300
committerAlabĂȘ Duarte <aduarte@thoughtworks.com>2015-02-24 00:36:07 -0300
commitf8df620a0df4c6bd8f6110067f74a79b3dd5840b (patch)
treeb0155eff7c01863e638ac8a812eed5d9614cd4d4 /web-ui/test
parent9480f4292b8284e411877958b9fb8c1cf9ec6dcf (diff)
#192 - highlights only words that matches with the keywords given
Diffstat (limited to 'web-ui/test')
-rw-r--r--web-ui/test/spec/search/results_highlighter.spec.js20
1 files changed, 20 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
new file mode 100644
index 00000000..1631cf01
--- /dev/null
+++ b/web-ui/test/spec/search/results_highlighter.spec.js
@@ -0,0 +1,20 @@
+describeComponent('search/results_highlighter', function () {
+ 'use strict';
+ var self;
+
+ beforeEach(function () {
+ self = this;
+ });
+
+ it('highlights only words that matches with the keywords given', function () {
+ this.setupComponent('<div id="text">Any one seeing too many open bugs</div>');
+
+ this.component.attr = {keywords: ["any"]};
+ self.component.highlightResults(event, {where: '#text'});
+
+ var highlightedWords = self.component.$node.find('.search-highlight').length;
+
+ expect(highlightedWords).toEqual(1);
+ });
+
+});