diff options
Diffstat (limited to 'spec/frontend/vue_shared/components/listbox_input/listbox_input_spec.js')
-rw-r--r-- | spec/frontend/vue_shared/components/listbox_input/listbox_input_spec.js | 28 |
1 files changed, 24 insertions, 4 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 397fd270344..b782a2b19da 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,7 +7,7 @@ describe('ListboxInput', () => { // Props const label = 'label'; - const decription = 'decription'; + const description = 'description'; const name = 'name'; const defaultToggleText = 'defaultToggleText'; const items = [ @@ -34,7 +34,7 @@ describe('ListboxInput', () => { wrapper = shallowMount(ListboxInput, { propsData: { label, - decription, + description, name, defaultToggleText, items, @@ -72,8 +72,8 @@ describe('ListboxInput', () => { expect(findGlFormGroup().attributes('label')).toBe(label); }); - it('passes the decription to the form group', () => { - expect(findGlFormGroup().attributes('decription')).toBe(decription); + it('passes the description to the form group', () => { + expect(findGlFormGroup().attributes('description')).toBe(description); }); it('sets the input name', () => { @@ -89,6 +89,26 @@ describe('ListboxInput', () => { }); }); + describe('props', () => { + it.each([true, false])("passes %s to the listbox's fluidWidth prop", (fluidWidth) => { + createComponent({ fluidWidth }); + + expect(findGlListbox().props('fluidWidth')).toBe(fluidWidth); + }); + + it.each(['right', 'left'])("passes %s to the listbox's placement prop", (placement) => { + createComponent({ placement }); + + expect(findGlListbox().props('placement')).toBe(placement); + }); + + it.each([true, false])("passes %s to the listbox's block prop", (block) => { + createComponent({ block }); + + expect(findGlListbox().props('block')).toBe(block); + }); + }); + describe('toggle text', () => { it('uses the default toggle text while no value is selected', () => { createComponent(); |