diff options
Diffstat (limited to 'spec/frontend/pipeline_wizard')
3 files changed, 16 insertions, 5 deletions
diff --git a/spec/frontend/pipeline_wizard/components/editor_spec.js b/spec/frontend/pipeline_wizard/components/editor_spec.js index 446412a4f02..540a08d2c7f 100644 --- a/spec/frontend/pipeline_wizard/components/editor_spec.js +++ b/spec/frontend/pipeline_wizard/components/editor_spec.js @@ -42,7 +42,7 @@ describe('Pages Yaml Editor wrapper', () => { it('does not cause the touch event to be emitted', () => { wrapper.setProps({ doc }); - expect(wrapper.emitted('touch')).not.toBeTruthy(); + expect(wrapper.emitted('touch')).toBeUndefined(); }); }); @@ -63,7 +63,7 @@ describe('Pages Yaml Editor wrapper', () => { it('emits touch if content is changed in editor', async () => { await wrapper.vm.editor.setValue('foo: boo'); - expect(wrapper.emitted('touch')).toBeTruthy(); + expect(wrapper.emitted('touch')).toEqual([expect.any(Array)]); }); }); }); diff --git a/spec/frontend/pipeline_wizard/components/step_spec.js b/spec/frontend/pipeline_wizard/components/step_spec.js index aa87b1d0b04..00b57f95ccc 100644 --- a/spec/frontend/pipeline_wizard/components/step_spec.js +++ b/spec/frontend/pipeline_wizard/components/step_spec.js @@ -139,7 +139,7 @@ describe('Pipeline Wizard - Step Page', () => { await mockPrevClick(); await nextTick(); - expect(wrapper.emitted().back).toBeTruthy(); + expect(wrapper.emitted().back).toEqual(expect.arrayContaining([])); }); it('lets "next" event bubble upwards', async () => { @@ -148,7 +148,7 @@ describe('Pipeline Wizard - Step Page', () => { await mockNextClick(); await nextTick(); - expect(wrapper.emitted().next).toBeTruthy(); + expect(wrapper.emitted().next).toEqual(expect.arrayContaining([])); }); }); diff --git a/spec/frontend/pipeline_wizard/components/widgets/checklist_spec.js b/spec/frontend/pipeline_wizard/components/widgets/checklist_spec.js index 43719595c5c..b8e194015b0 100644 --- a/spec/frontend/pipeline_wizard/components/widgets/checklist_spec.js +++ b/spec/frontend/pipeline_wizard/components/widgets/checklist_spec.js @@ -1,4 +1,4 @@ -import { GlFormCheckbox, GlFormCheckboxGroup } from '@gitlab/ui'; +import { GlFormCheckbox, GlFormGroup, GlFormCheckboxGroup } from '@gitlab/ui'; import { nextTick } from 'vue'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import ChecklistWidget from '~/pipeline_wizard/components/widgets/checklist.vue'; @@ -21,6 +21,7 @@ describe('Pipeline Wizard - Checklist Widget', () => { return eventArray[eventArray.length - 1]; }; const findItem = (atIndex = 0) => wrapper.findAllComponents(GlFormCheckbox).at(atIndex); + const getGlFormGroup = () => wrapper.getComponent(GlFormGroup); const getGlFormCheckboxGroup = () => wrapper.getComponent(GlFormCheckboxGroup); // The item.ids *can* be passed inside props.items, but are usually @@ -57,6 +58,16 @@ describe('Pipeline Wizard - Checklist Widget', () => { expect(findItem().text()).toBe(props.items[0]); }); + it('assigns the same non-null value to label-for and form id', () => { + createComponent(); + const formGroupLabelFor = getGlFormGroup().attributes('label-for'); + const formCheckboxGroupId = getGlFormCheckboxGroup().attributes('id'); + + expect(formGroupLabelFor).not.toBeNull(); + expect(formCheckboxGroupId).not.toBeNull(); + expect(formGroupLabelFor).toBe(formCheckboxGroupId); + }); + it('displays an item with a help text', () => { createComponent(); const { text, help } = props.items[1]; |