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

gemfile_linker_spec.js « utils « 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: 4e188c9af7ee1ec83e224df1fe313a4b66acdfca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import gemfileLinker from '~/vue_shared/components/source_viewer/plugins/utils/gemfile_linker';

describe('Highlight.js plugin for linking gemfile dependencies', () => {
  it('mutates the input value by wrapping dependency names in anchors', () => {
    const inputValue = 'gem </span><span class="hljs-string">&#39;paranoia&#39;';
    const outputValue =
      'gem </span><span class="hljs-string">&#39;<a href="https://rubygems.org/gems/paranoia" target="_blank" rel="nofollow noreferrer noopener">paranoia</a>&#39;';
    const hljsResultMock = { value: inputValue };

    const output = gemfileLinker(hljsResultMock);
    expect(output).toBe(outputValue);
  });
});