debian-mirror-gitlab/spec/frontend/terraform/components/empty_state_spec.js

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

29 lines
858 B
JavaScript
Raw Normal View History

2021-10-27 15:23:28 +05:30
import { GlEmptyState, GlLink } from '@gitlab/ui';
2021-01-29 00:20:46 +05:30
import { shallowMount } from '@vue/test-utils';
import EmptyState from '~/terraform/components/empty_state.vue';
describe('EmptyStateComponent', () => {
let wrapper;
const propsData = {
image: '/image/path',
};
2022-05-07 20:08:51 +05:30
const docsUrl = '/help/user/infrastructure/iac/terraform_state';
2021-10-27 15:23:28 +05:30
const findEmptyState = () => wrapper.findComponent(GlEmptyState);
const findLink = () => wrapper.findComponent(GlLink);
2021-01-29 00:20:46 +05:30
beforeEach(() => {
2022-06-21 17:19:12 +05:30
wrapper = shallowMount(EmptyState, { propsData });
});
2021-01-29 00:20:46 +05:30
it('should render content', () => {
2022-06-21 17:19:12 +05:30
expect(findEmptyState().props('title')).toBe(
"Your project doesn't have any Terraform state files",
);
2021-01-29 00:20:46 +05:30
});
2021-10-27 15:23:28 +05:30
2022-06-21 17:19:12 +05:30
it('should have a link to the GitLab managed Terraform states docs', () => {
2021-10-27 15:23:28 +05:30
expect(findLink().attributes('href')).toBe(docsUrl);
});
2021-01-29 00:20:46 +05:30
});