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',
|
|
|
|
};
|
2022-03-11 19:07:24 -05:00
|
|
|
const docsUrl = '/help/user/infrastructure/iac/terraform_state';
|
2021-08-04 08:10:30 -04:00
|
|
|
const findEmptyState = () => wrapper.findComponent(GlEmptyState);
|
|
|
|
const findLink = () => wrapper.findComponent(GlLink);
|
2020-11-06 07:09:17 -05:00
|
|
|
|
|
|
|
beforeEach(() => {
|
2022-04-14 05:10:34 -04:00
|
|
|
wrapper = shallowMount(EmptyState, { propsData });
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
wrapper.destroy();
|
2020-11-06 07:09:17 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should render content', () => {
|
2022-04-14 05:10:34 -04:00
|
|
|
expect(findEmptyState().props('title')).toBe(
|
|
|
|
"Your project doesn't have any Terraform state files",
|
|
|
|
);
|
2020-11-06 07:09:17 -05:00
|
|
|
});
|
2021-08-04 08:10:30 -04:00
|
|
|
|
2022-04-14 05:10:34 -04:00
|
|
|
it('should have a link to the GitLab managed Terraform states docs', () => {
|
2021-08-04 08:10:30 -04:00
|
|
|
expect(findLink().attributes('href')).toBe(docsUrl);
|
|
|
|
});
|
2020-11-06 07:09:17 -05:00
|
|
|
});
|