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

28 lines
887 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',
};
2021-10-27 15:23:28 +05:30
const docsUrl = '/help/user/infrastructure/terraform_state';
const findEmptyState = () => wrapper.findComponent(GlEmptyState);
const findLink = () => wrapper.findComponent(GlLink);
2021-01-29 00:20:46 +05:30
beforeEach(() => {
2021-10-27 15:23:28 +05:30
wrapper = shallowMount(EmptyState, { propsData, stubs: { GlEmptyState, GlLink } });
2021-01-29 00:20:46 +05:30
});
it('should render content', () => {
2021-10-27 15:23:28 +05:30
expect(findEmptyState().exists()).toBe(true);
2021-01-29 00:20:46 +05:30
expect(wrapper.text()).toContain('Get started with Terraform');
});
2021-10-27 15:23:28 +05:30
it('should have a link to the GitLab managed Terraform States docs', () => {
expect(findLink().attributes('href')).toBe(docsUrl);
});
2021-01-29 00:20:46 +05:30
});