2022-03-25 15:35:56 +08:00
|
|
|
import { describe, expect, it } from 'vitest'
|
2020-12-21 20:07:48 +08:00
|
|
|
import makeMount from '@element-plus/test-utils/make-mount'
|
2021-11-14 22:55:50 +08:00
|
|
|
import SkeletonItem from '../src/skeleton-item.vue'
|
2020-12-21 20:07:48 +08:00
|
|
|
|
|
|
|
describe('<skeleton-item />', () => {
|
|
|
|
const mount = makeMount(SkeletonItem, {})
|
|
|
|
|
2022-03-13 20:53:05 +08:00
|
|
|
it('should render correctly', () => {
|
2020-12-21 20:07:48 +08:00
|
|
|
const wrapper = mount()
|
|
|
|
|
|
|
|
expect(wrapper.find('.el-skeleton__text').exists()).toBe(true)
|
|
|
|
})
|
|
|
|
|
2022-03-13 20:53:05 +08:00
|
|
|
it('should render image placeholder', () => {
|
2020-12-21 20:07:48 +08:00
|
|
|
const wrapper = mount({
|
|
|
|
props: {
|
|
|
|
variant: 'image',
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
expect(wrapper.find('svg').exists()).toBe(true)
|
|
|
|
})
|
|
|
|
})
|