diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-30 12:08:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-30 12:08:38 +0300 |
commit | 8ca437b79438e914b2eede563906e7889c81dc19 (patch) | |
tree | a736452eff9c2d6353498f9ad366b231103062ad /spec/frontend/vue_shared/components/listbox_input | |
parent | 142658ee280a72a0cb45b241c43ddc495d852814 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared/components/listbox_input')
-rw-r--r-- | spec/frontend/vue_shared/components/listbox_input/listbox_input_spec.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/frontend/vue_shared/components/listbox_input/listbox_input_spec.js b/spec/frontend/vue_shared/components/listbox_input/listbox_input_spec.js index 2b62cbb9ab3..f7c705c495a 100644 --- a/spec/frontend/vue_shared/components/listbox_input/listbox_input_spec.js +++ b/spec/frontend/vue_shared/components/listbox_input/listbox_input_spec.js @@ -7,6 +7,7 @@ describe('ListboxInput', () => { // Props const label = 'label'; + const decription = 'decription'; const name = 'name'; const defaultToggleText = 'defaultToggleText'; const items = [ @@ -32,6 +33,7 @@ describe('ListboxInput', () => { wrapper = shallowMount(ListboxInput, { propsData: { label, + decription, name, defaultToggleText, items, @@ -40,6 +42,23 @@ describe('ListboxInput', () => { }); }; + describe('wrapper', () => { + it.each` + description | labelProp | descriptionProp | rendersGlFormGroup + ${'does not render'} | ${''} | ${''} | ${false} + ${'renders'} | ${'labelProp'} | ${''} | ${true} + ${'renders'} | ${''} | ${'descriptionProp'} | ${true} + ${'renders'} | ${'labelProp'} | ${'descriptionProp'} | ${true} + `( + "$description a GlFormGroup when label is '$labelProp' and description is '$descriptionProp'", + ({ labelProp, descriptionProp, rendersGlFormGroup }) => { + createComponent({ label: labelProp, description: descriptionProp }); + + expect(findGlFormGroup().exists()).toBe(rendersGlFormGroup); + }, + ); + }); + describe('options', () => { beforeEach(() => { createComponent(); @@ -49,6 +68,10 @@ describe('ListboxInput', () => { expect(findGlFormGroup().attributes('label')).toBe(label); }); + it('passes the decription to the form group', () => { + expect(findGlFormGroup().attributes('decription')).toBe(decription); + }); + it('sets the input name', () => { expect(findInput().attributes('name')).toBe(name); }); |