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

podspec_json_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: 0ef63de68c62269ad2b287bfa6a24d6e7e63cb6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import podspecJsonLinker from '~/vue_shared/components/source_viewer/plugins/utils/podspec_json_linker';
import { PODSPEC_JSON_CONTENT } from '../mock_data';

describe('Highlight.js plugin for linking podspec_json dependencies', () => {
  it('mutates the input value by wrapping dependency names in anchors', () => {
    const inputValue =
      '<span class="hljs-attr">&quot;AFNetworking/Security&quot;</span><span class="hljs-punctuation">:</span><span class=""> </span><span class="hljs-punctuation">[';
    const outputValue =
      '<span class="hljs-attr">&quot;<a href="https://cocoapods.org/pods/AFNetworking" target="_blank" rel="nofollow noreferrer noopener">AFNetworking/Security</a>&quot;</span><span class="hljs-punctuation">:</span><span class=""> </span><span class="hljs-punctuation">[';
    const hljsResultMock = { value: inputValue };
    const output = podspecJsonLinker(hljsResultMock, PODSPEC_JSON_CONTENT);
    expect(output).toBe(outputValue);
  });
});