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

status_filter_spec.js « components « sidebar « search « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c230341c1723c7af8491b71d056ef6cc99df62cd (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
36
37
38
39
40
41
42
43
44
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
// eslint-disable-next-line no-restricted-imports
import Vuex from 'vuex';
import RadioFilter from '~/search/sidebar/components/radio_filter.vue';
import StatusFilter from '~/search/sidebar/components/status_filter/index.vue';

Vue.use(Vuex);

describe('StatusFilter', () => {
  let wrapper;

  const createComponent = (state) => {
    const store = new Vuex.Store({
      state,
    });

    wrapper = shallowMount(StatusFilter, {
      store,
    });
  };

  const findRadioFilter = () => wrapper.findComponent(RadioFilter);

  describe('old sidebar', () => {
    beforeEach(() => {
      createComponent({ useSidebarNavigation: false });
    });

    it('renders the component', () => {
      expect(findRadioFilter().exists()).toBe(true);
    });
  });

  describe('new sidebar', () => {
    beforeEach(() => {
      createComponent({ useSidebarNavigation: true });
    });

    it('renders the component', () => {
      expect(findRadioFilter().exists()).toBe(true);
    });
  });
});