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

app_spec.js « components « static_site_editor « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bbdffeae68fb6d388cc99b9f9d8a5df0295f9477 (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
import { shallowMount } from '@vue/test-utils';
import App from '~/static_site_editor/components/app.vue';

describe('static_site_editor/components/app', () => {
  const mergeRequestsIllustrationPath = 'illustrations/merge_requests.svg';
  const RouterView = {
    template: '<div></div>',
  };
  let wrapper;

  const buildWrapper = () => {
    wrapper = shallowMount(App, {
      stubs: {
        RouterView,
      },
      propsData: {
        mergeRequestsIllustrationPath,
      },
    });
  };

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

  it('passes merge request illustration path to the router view component', () => {
    buildWrapper();

    expect(wrapper.find(RouterView).attributes()).toMatchObject({
      'merge-requests-illustration-path': mergeRequestsIllustrationPath,
    });
  });
});