Welcome to mirror list, hosted at ThFree Co, Russian Federation.

search_spec.js « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d234a7fccb90feeb2c7889d8c0a8f2dd3c744a9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import setHighlightClass from 'ee_else_ce/search/highlight_blob_search_result';
import Search from '~/pages/search/show/search';

jest.mock('~/api');
jest.mock('ee_else_ce/search/highlight_blob_search_result');

describe('Search', () => {
  const fixturePath = 'search/show.html';

  preloadFixtures(fixturePath);

  describe('constructor side effects', () => {
    afterEach(() => {
      jest.restoreAllMocks();
    });

    it('highlights lines with search terms in blob search results', () => {
      new Search(); // eslint-disable-line no-new

      expect(setHighlightClass).toHaveBeenCalled();
    });
  });
});