import { mount } from '@vue/test-utils'; import ShSelect from '@/components/ShSelect.vue'; describe('ShSelect', () => { const mockProps = { label: 'Label', childRef: 'childRef' }; const createWrapper = (props = {}, slots = {}) => mount(ShSelect, { props: { ...mockProps, ...props }, slots: { append: `` }, attrs: { 'data-testid': 'button' } }); it('renders correctly if label is a string', () => { const wrapper = createWrapper(); expect(wrapper.find('[data-testid="label"]').exists()).toBe(true); }); it('does not renders correctly if label is null', () => { const wrapper = createWrapper({ label: false }); expect(wrapper.find('[data-testid="label"]').exists()).toBe(false); }); });