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

blob_embeddable_spec.js « components « blob « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b2fe71f140154ed87b99d33bc3e883ba579dcb32 (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
27
28
29
30
31
32
33
34
35
import { shallowMount } from '@vue/test-utils';
import BlobEmbeddable from '~/blob/components/blob_embeddable.vue';
import { GlFormInputGroup } from '@gitlab/ui';

describe('Blob Embeddable', () => {
  let wrapper;
  const url = 'https://foo.bar';

  function createComponent() {
    wrapper = shallowMount(BlobEmbeddable, {
      propsData: {
        url,
      },
    });
  }

  beforeEach(() => {
    createComponent();
  });

  afterEach(() => {
    wrapper.destroy();
  });

  it('renders gl-form-input-group component', () => {
    expect(wrapper.find(GlFormInputGroup).exists()).toBe(true);
  });

  it('makes up optionValues based on the url prop', () => {
    expect(wrapper.vm.optionValues).toEqual([
      { name: 'Embed', value: expect.stringContaining(`${url}.js`) },
      { name: 'Share', value: url },
    ]);
  });
});