import { UListItemGroup } from './UListItemGroup' import { describe, it, expect } from 'vitest' import { mount } from '@vue/test-utils' describe('UListItemGroup', () => { it('should render correctly', () => { const wrapper = mount(UListItemGroup) expect(wrapper.html()).toMatchSnapshot() }) it('should switch isActive mode on click', async () => { const wrapper = mount(UListItemGroup) await wrapper.find('div.item').trigger('click') expect(wrapper.vm.isActive).toBe(true) }) it('should render without slot when small type is passed', () => { const wrapper = mount(UListItemGroup, { slots: { default: 'Test', }, props: { type: 'small', }, }) expect(wrapper.html()).toMatchSnapshot() }) it('should render with slot when default type is passed', () => { const wrapper = mount(UListItemGroup, { slots: { default: 'Test', }, props: { type: 'default', }, }) expect(wrapper.html()).toMatchSnapshot() }) it('should render prependIcon when prependIcon is true', () => { const wrapper = mount(UListItemGroup, { props: { prependIcon: 'user1', }, }) expect(wrapper.html()).toMatchSnapshot() const iconComponent = wrapper.findComponent({ name: 'UIcon' }) expect(iconComponent.exists()).toBe(true) expect(iconComponent.props('icon')).toBe('$user1') }) })