import { UTableCell } from './UTableCell' import { describe, it, expect } from 'vitest' import { mount } from '@vue/test-utils' describe('UTableCell', () => { it('should render correctly', () => { const wrapper = mount(UTableCell) expect(wrapper.html()).toMatchSnapshot() }) it('should render checkbox if isChecked prop true', async () => { const wrapper = mount(UTableCell, { props: { isChecked: true, }, }) expect(wrapper.html()).toMatchSnapshot() expect(wrapper.findComponent({ name: 'UCheckbox' }).exists()).toBe(true) await wrapper.findComponent({ name: 'UCheckbox' }).trigger('click') expect(wrapper.emitted('click')).toBeTruthy() }) it('should be in a disabled state if disabled is true', () => { const wrapper = mount(UTableCell, { props: { disabled: true, }, }) expect(wrapper.html()).toMatchSnapshot() }) it('should render with height prop', () => { const wrapper = mount(UTableCell, { props: { height: '100', }, }) expect(wrapper.html()).toMatchSnapshot() }) })