summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/search/results_highlighter.spec.js
blob: c65a042b6117b69bf63cbb80a3369799ed816e91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 () {
    self.setupComponent('<div id="text">Any one seeing too many open bugs</div>');

    self.component.attr = {keywords: ["any"]};
    self.component.highlightResults(event, {where: '#text'});

    var highlightedWords = self.component.$node.find('.search-highlight').length;

    expect(highlightedWords).toEqual(1);
  });

});