debian-mirror-gitlab/spec/frontend/terraform/components/empty_state_spec.js
2022-05-07 20:08:51 +05:30

27 lines
891 B
JavaScript

import { GlEmptyState, GlLink } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import EmptyState from '~/terraform/components/empty_state.vue';
describe('EmptyStateComponent', () => {
let wrapper;
const propsData = {
image: '/image/path',
};
const docsUrl = '/help/user/infrastructure/iac/terraform_state';
const findEmptyState = () => wrapper.findComponent(GlEmptyState);
const findLink = () => wrapper.findComponent(GlLink);
beforeEach(() => {
wrapper = shallowMount(EmptyState, { propsData, stubs: { GlEmptyState, GlLink } });
});
it('should render content', () => {
expect(findEmptyState().exists()).toBe(true);
expect(wrapper.text()).toContain('Get started with Terraform');
});
it('should have a link to the GitLab managed Terraform States docs', () => {
expect(findLink().attributes('href')).toBe(docsUrl);
});
});