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

router_spec.js « work_items « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0a57eab753f5093c9c5485ca6f6f2a92a92dcdf7 (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
import { mount } from '@vue/test-utils';
import App from '~/work_items/components/app.vue';
import WorkItemsRoot from '~/work_items/pages/work_item_root.vue';
import { createRouter } from '~/work_items/router';

describe('Work items router', () => {
  let wrapper;

  const createComponent = async (routeArg) => {
    const router = createRouter('/work_item');
    if (routeArg !== undefined) {
      await router.push(routeArg);
    }

    wrapper = mount(App, {
      router,
    });
  };

  afterEach(() => {
    wrapper.destroy();
    window.location.hash = '';
  });

  it('renders work item on `/1` route', async () => {
    await createComponent('/1');

    expect(wrapper.find(WorkItemsRoot).exists()).toBe(true);
  });
});