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

footnote_definition_spec.js « wrappers « components « content_editor « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 91c6799478e6e346d120e3f653629ff45062cbef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import FootnoteDefinitionWrapper from '~/content_editor/components/wrappers/footnote_definition.vue';

describe('content/components/wrappers/footnote_definition', () => {
  let wrapper;

  const createWrapper = async (node = {}) => {
    wrapper = shallowMountExtended(FootnoteDefinitionWrapper, {
      propsData: {
        node,
      },
    });
  };

  it('renders footnote label as a readyonly element', () => {
    const label = 'footnote';

    createWrapper({
      attrs: {
        label,
      },
    });
    expect(wrapper.text()).toContain(label);
    expect(wrapper.findByTestId('footnote-label').attributes().contenteditable).toBe('false');
  });
});