import { mount } from '@vue/test-utils' import { describe, expect, it } from 'vitest' import BaseRadioGroup from '../../components/BaseRadioGroup.vue' describe('BaseRadioGroup', () => { it('accepts string and number shorthand options', async () => { const wrapper = mount(BaseRadioGroup, { props: { name: 'plate-format', modelValue: 96, options: [96, 384, { value: 'custom', label: 'Custom' }], }, }) expect(wrapper.findAll('.mint-radio-option__label').map(label => label.text())).toEqual([ '96', '384', 'Custom', ]) await wrapper.findAll('input')[1].setValue(true) expect(wrapper.emitted('update:modelValue')?.[0]).toEqual([384]) }) it('should render the list wrapper without a size box when size is set', () => { const wrapper = mount(BaseRadioGroup, { props: { name: 'mode', size: 'lg', options: ['linear', 'log'] }, }) expect(wrapper.get('.mint-radio-option__input-wrapper').classes()).toEqual(['mint-radio-option__input-wrapper']) }) })