debian-mirror-gitlab/spec/frontend/releases/components/releases_empty_state_spec.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.3 KiB
JavaScript
Raw Normal View History

2021-09-04 01:27:46 +05:30
import { GlEmptyState } from '@gitlab/ui';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import ReleasesEmptyState from '~/releases/components/releases_empty_state.vue';
describe('releases_empty_state.vue', () => {
const documentationPath = 'path/to/releases/documentation';
2023-04-23 21:23:45 +05:30
const newReleasePath = 'path/to/releases/new-release';
2021-09-04 01:27:46 +05:30
const illustrationPath = 'path/to/releases/empty/state/illustration';
let wrapper;
const createComponent = () => {
wrapper = shallowMountExtended(ReleasesEmptyState, {
provide: {
documentationPath,
2023-04-23 21:23:45 +05:30
newReleasePath,
2021-09-04 01:27:46 +05:30
illustrationPath,
},
});
};
beforeEach(() => {
createComponent();
});
it('renders a GlEmptyState and provides it with the correct props', () => {
const emptyStateProps = wrapper.findComponent(GlEmptyState).props();
2023-04-23 21:23:45 +05:30
expect(emptyStateProps).toMatchObject({
title: ReleasesEmptyState.i18n.emptyStateTitle,
svgPath: illustrationPath,
description: ReleasesEmptyState.i18n.emptyStateText,
primaryButtonLink: newReleasePath,
primaryButtonText: ReleasesEmptyState.i18n.newRelease,
secondaryButtonLink: documentationPath,
secondaryButtonText: ReleasesEmptyState.i18n.releasesDocumentation,
});
2021-09-04 01:27:46 +05:30
});
});