element-plus/packages/radio/__tests__/radio.spec.ts
2020-08-11 14:49:40 +08:00

20 lines
524 B
TypeScript

import { mount } from '@vue/test-utils'
import Radio from '../src/radio.vue'
describe('Radio', () => {
test('create', async () => {
const TestComponent = {
template: `<el-radio v-model="radio" label="a">
</el-radio>`,
components: {
'el-radio': Radio,
},
data: () => ({ radio: '' }),
}
const wrapper = mount(TestComponent)
expect(wrapper.classes()).toContain('el-radio')
await wrapper.trigger('click')
expect(wrapper.classes()).toContain('is-checked')
})
})