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

index_spec.js « plugins « source_viewer « components « vue_shared « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 83fdc5d669d5cec771f3755f7c159a28a1b54b4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { registerPlugins } from '~/vue_shared/components/source_viewer/plugins/index';
import { HLJS_ON_AFTER_HIGHLIGHT } from '~/vue_shared/components/source_viewer/constants';
import wrapComments from '~/vue_shared/components/source_viewer/plugins/wrap_comments';

jest.mock('~/vue_shared/components/source_viewer/plugins/wrap_comments');
const hljsMock = { addPlugin: jest.fn() };

describe('Highlight.js plugin registration', () => {
  beforeEach(() => registerPlugins(hljsMock));

  it('registers our plugins', () => {
    expect(hljsMock.addPlugin).toHaveBeenCalledWith({ [HLJS_ON_AFTER_HIGHLIGHT]: wrapComments });
  });
});