summaryrefslogtreecommitdiff
path: root/spec/frontend/ide/components/pipelines/empty_state_spec.js
blob: f7409fc36be26605ea533ddcbfbe79de07bd0f31 (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 { GlEmptyState } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import EmptyState from '~/ide/components/pipelines/empty_state.vue';
import { createStore } from '~/ide/stores';

const TEST_PIPELINES_EMPTY_STATE_SVG_PATH = 'illustrations/test/pipelines.svg';

describe('~/ide/components/pipelines/empty_state.vue', () => {
  let store;
  let wrapper;

  const createComponent = () => {
    wrapper = shallowMount(EmptyState, {
      store,
    });
  };

  beforeEach(() => {
    store = createStore();
    store.dispatch('setEmptyStateSvgs', {
      pipelinesEmptyStateSvgPath: TEST_PIPELINES_EMPTY_STATE_SVG_PATH,
    });
  });

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

  describe('default', () => {
    beforeEach(() => {
      createComponent();
    });

    it('renders empty state', () => {
      expect(wrapper.find(GlEmptyState).props()).toMatchObject({
        title: EmptyState.i18n.title,
        description: EmptyState.i18n.description,
        primaryButtonText: EmptyState.i18n.primaryButtonText,
        primaryButtonLink: '/help/ci/quick_start/index.md',
        svgPath: TEST_PIPELINES_EMPTY_STATE_SVG_PATH,
      });
    });
  });
});