debian-mirror-gitlab/spec/frontend/pipeline_editor/components/validate/ci_validate_spec.js
2022-07-23 20:15:48 +02:00

40 lines
1.1 KiB
JavaScript

import { GlButton, GlDropdown } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import CiValidate, { i18n } from '~/pipeline_editor/components/validate/ci_validate.vue';
describe('Pipeline Editor Validate Tab', () => {
let wrapper;
const createComponent = ({ stubs } = {}) => {
wrapper = shallowMount(CiValidate, {
provide: {
validateTabIllustrationPath: '/path/to/img',
},
stubs,
});
};
const findCta = () => wrapper.findComponent(GlButton);
const findPipelineSource = () => wrapper.findComponent(GlDropdown);
afterEach(() => {
wrapper.destroy();
});
describe('template', () => {
beforeEach(() => {
createComponent();
});
it('renders disabled pipeline source dropdown', () => {
expect(findPipelineSource().exists()).toBe(true);
expect(findPipelineSource().attributes('text')).toBe(i18n.pipelineSourceDefault);
expect(findPipelineSource().attributes('disabled')).toBe('true');
});
it('renders CTA', () => {
expect(findCta().exists()).toBe(true);
expect(findCta().text()).toBe(i18n.cta);
});
});
});