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

link_dependencies_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: 3036ce43888470499cc2f9de26727b998315add3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import packageJsonLinker from '~/vue_shared/components/source_viewer/plugins/utils/package_json_linker';
import linkDependencies from '~/vue_shared/components/source_viewer/plugins/link_dependencies';
import { PACKAGE_JSON_FILE_TYPE, PACKAGE_JSON_CONTENT } from './mock_data';

jest.mock('~/vue_shared/components/source_viewer/plugins/utils/package_json_linker');

describe('Highlight.js plugin for linking dependencies', () => {
  const hljsResultMock = { value: 'test' };

  it('calls packageJsonLinker for package_json file types', () => {
    linkDependencies(hljsResultMock, PACKAGE_JSON_FILE_TYPE, PACKAGE_JSON_CONTENT);
    expect(packageJsonLinker).toHaveBeenCalled();
  });
});