From a353be2944c2dec9676a07f4a282a34082058c3e Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 3 Dec 2019 09:11:10 -0800 Subject: [PATCH] fix(components): fix typo --- src/components/Select.vue | 2 +- tests/unit/Components.spec.js | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/components/Select.vue b/src/components/Select.vue index 6140895..1ef3891 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -1090,7 +1090,7 @@ }, openIndicator: { shouldDisplay: ! this.noDrop, - component: this.childComponents.openIndicator, + component: this.childComponents.OpenIndicator, attributes: { 'ref': 'openIndicator', 'role': 'presentation', diff --git a/tests/unit/Components.spec.js b/tests/unit/Components.spec.js index 191645f..efc7216 100644 --- a/tests/unit/Components.spec.js +++ b/tests/unit/Components.spec.js @@ -1,25 +1,28 @@ import Vue from 'vue'; -import { selectWithProps } from '../helpers'; +import { mountDefault, selectWithProps } from '../helpers'; +import components from '../../src/components/childComponents'; describe('Components API', () => { + it('uses the default components', () => { + const Select = mountDefault(); + expect(Select.contains(components.Deselect)).toBeTruthy(); + expect(Select.contains(components.OpenIndicator)).toBeTruthy(); + }); + it('swap the Deselect component', () => { const Deselect = Vue.component('Deselect', { - render (createElement) { - return createElement('span', 'remove'); - }, + render: (createElement) => createElement('span', 'remove'), }); - const Select = selectWithProps({components: {Deselect}}); + const Select = selectWithProps({components: {Deselect}, multiple: true}); expect(Select.contains(Deselect)).toBeTruthy(); }); it('swap the OpenIndicator component', () => { const OpenIndicator = Vue.component('OpenIndicator', { - render (createElement) { - return createElement('i', '^'); - }, + render: (createElement) => createElement('i', '^'), }); const Select = selectWithProps({components: {OpenIndicator}});