debian-mirror-gitlab/spec/frontend/vue_shared/components/multiselect_dropdown_spec.js

36 lines
919 B
JavaScript
Raw Normal View History

2021-04-17 20:07:23 +05:30
import { GlDropdown } from '@gitlab/ui';
2021-01-29 00:20:46 +05:30
import { getByText } from '@testing-library/dom';
2021-03-11 19:13:27 +05:30
import { shallowMount } from '@vue/test-utils';
2021-01-29 00:20:46 +05:30
import MultiSelectDropdown from '~/vue_shared/components/sidebar/multiselect_dropdown.vue';
describe('MultiSelectDropdown Component', () => {
it('renders items slot', () => {
const wrapper = shallowMount(MultiSelectDropdown, {
propsData: {
text: '',
headerText: '',
},
slots: {
items: '<p>Test</p>',
},
});
expect(getByText(wrapper.element, 'Test')).toBeDefined();
});
it('renders search slot', () => {
const wrapper = shallowMount(MultiSelectDropdown, {
propsData: {
text: '',
headerText: '',
},
slots: {
search: '<p>Search</p>',
},
2021-04-17 20:07:23 +05:30
stubs: {
GlDropdown,
},
2021-01-29 00:20:46 +05:30
});
expect(getByText(wrapper.element, 'Search')).toBeDefined();
});
});