diff options
Diffstat (limited to 'spec/frontend/pipeline_editor/components/validate/ci_validate_spec.js')
-rw-r--r-- | spec/frontend/pipeline_editor/components/validate/ci_validate_spec.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/frontend/pipeline_editor/components/validate/ci_validate_spec.js b/spec/frontend/pipeline_editor/components/validate/ci_validate_spec.js new file mode 100644 index 00000000000..25972317593 --- /dev/null +++ b/spec/frontend/pipeline_editor/components/validate/ci_validate_spec.js @@ -0,0 +1,40 @@ +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); + }); + }); +}); |