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

html_spec.js « output « cells « notebook « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b94ce7c684d219dbbe37b7238b85ac06920555d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { mount } from '@vue/test-utils';
import HtmlOutput from '~/notebook/cells/output/html.vue';
import sanitizeTests from './html_sanitize_fixtures';

describe('html output cell', () => {
  function createComponent(rawCode) {
    return mount(HtmlOutput, {
      propsData: {
        rawCode,
        count: 0,
        index: 0,
      },
    });
  }

  it.each(sanitizeTests)('sanitizes output for: %p', (name, { input, output }) => {
    const vm = createComponent(input);

    expect(vm.html()).toContain(output);
  });
});