mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-19 09:50:33 +03:00
Add API for overwriting default components (#850)
* implement API for overwriting child components * add test coverage * update documentation for Components & Styling * update docs * refactor API, update docs * remove the service worker * fix tests
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import Vue from 'vue';
|
||||
import { selectWithProps } from '../helpers';
|
||||
|
||||
describe('Components API', () => {
|
||||
|
||||
it('swap the Deselect component', () => {
|
||||
const Deselect = Vue.component('Deselect', {
|
||||
render (createElement) {
|
||||
return createElement('button', 'remove');
|
||||
},
|
||||
});
|
||||
|
||||
const Select = selectWithProps({components: {Deselect}});
|
||||
|
||||
expect(Select.contains(Deselect)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('swap the OpenIndicator component', () => {
|
||||
const OpenIndicator = Vue.component('OpenIndicator', {
|
||||
render (createElement) {
|
||||
return createElement('i', '^');
|
||||
},
|
||||
});
|
||||
|
||||
const Select = selectWithProps({components: {OpenIndicator}});
|
||||
|
||||
expect(Select.contains(OpenIndicator)).toBeTruthy();
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user