debian-mirror-gitlab/spec/frontend/ide/components/pipelines/empty_state_spec.js
2022-01-26 12:08:38 +05:30

44 lines
1.2 KiB
JavaScript

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,
});
});
});
});