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