element-plus/packages/components/icon/__tests__/icon.spec.ts

16 lines
406 B
TypeScript
Raw Normal View History

2020-08-04 11:09:19 +08:00
import { mount } from '@vue/test-utils'
import Icon from '../src/icon.vue'
2020-08-04 11:09:19 +08:00
describe('Icon.vue', () => {
test('render', () => {
const wrapper = mount(Icon, {
props: {
color: '#000000',
size: 18,
2020-08-04 11:09:19 +08:00
},
})
expect(wrapper.element.getAttribute('style')).toContain(`--color: #000000`)
2021-12-12 22:33:48 +08:00
expect(wrapper.element.getAttribute('style')).toContain(`font-size: 18px`)
2020-08-04 11:09:19 +08:00
})
})