mirror of
https://github.com/directus/directus.git
synced 2026-02-05 10:29:03 -05:00
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import { createLocalVue, shallowMount } from '@vue/test-utils';
|
|
import VueCompositionAPI from '@vue/composition-api';
|
|
|
|
import VNotice from '@/components/v-notice';
|
|
import VSelect from '@/components/v-select';
|
|
import VIcon from '@/components/v-icon';
|
|
import InterfaceDropdown from './dropdown.vue';
|
|
import VueI18n from 'vue-i18n';
|
|
import i18n from '@/lang';
|
|
|
|
const localVue = createLocalVue();
|
|
localVue.use(VueCompositionAPI);
|
|
localVue.use(VueI18n);
|
|
localVue.component('v-select', VSelect);
|
|
localVue.component('v-notice', VNotice);
|
|
localVue.component('v-icon', VIcon);
|
|
|
|
describe('Interfaces / Dropdown', () => {
|
|
it('Renders a notice when choices arent set', async () => {
|
|
const component = shallowMount(InterfaceDropdown, {
|
|
localVue,
|
|
i18n,
|
|
listeners: {
|
|
input: () => undefined,
|
|
},
|
|
});
|
|
expect(component.find(VNotice).exists()).toBe(true);
|
|
});
|
|
|
|
it('Renders select when choices exist', async () => {
|
|
const component = shallowMount(InterfaceDropdown, {
|
|
localVue,
|
|
i18n,
|
|
listeners: {
|
|
input: () => undefined,
|
|
},
|
|
propsData: {
|
|
choices: `
|
|
test
|
|
`,
|
|
},
|
|
});
|
|
expect(component.find(VSelect).exists()).toBe(true);
|
|
});
|
|
});
|