2020-08-04 11:09:19 +08:00
|
|
|
import { mount } from '@vue/test-utils'
|
2022-04-19 12:46:57 +08:00
|
|
|
import { describe, expect, test } from 'vitest'
|
2021-09-22 00:46:23 +08:00
|
|
|
import Icon from '../src/icon.vue'
|
2020-08-04 11:09:19 +08:00
|
|
|
|
|
|
|
describe('Icon.vue', () => {
|
|
|
|
test('render', () => {
|
|
|
|
const wrapper = mount(Icon, {
|
|
|
|
props: {
|
2021-07-30 11:29:25 +08:00
|
|
|
color: '#000000',
|
|
|
|
size: 18,
|
2020-08-04 11:09:19 +08:00
|
|
|
},
|
|
|
|
})
|
2021-09-04 19:29:28 +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
|
|
|
})
|
|
|
|
})
|