gitlab-org--gitlab-foss/spec/frontend/vue_shared/components/multiselect_dropdown_spec.js

31 lines
834 B
JavaScript

import { shallowMount } from '@vue/test-utils';
import { getByText } from '@testing-library/dom';
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>',
},
});
expect(getByText(wrapper.element, 'Search')).toBeDefined();
});
});