2022-06-15 01:31:56 +08:00
|
|
|
import { mount } from '@vue/test-utils'
|
2022-03-25 15:35:56 +08:00
|
|
|
import { describe, expect, it } from 'vitest'
|
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 />', () => {
|
2022-03-13 20:53:05 +08:00
|
|
|
it('should render correctly', () => {
|
2022-06-15 01:31:56 +08:00
|
|
|
const wrapper = mount(<SkeletonItem />)
|
2020-12-21 20:07:48 +08:00
|
|
|
|
|
|
|
expect(wrapper.find('.el-skeleton__text').exists()).toBe(true)
|
|
|
|
})
|
|
|
|
|
2022-03-13 20:53:05 +08:00
|
|
|
it('should render image placeholder', () => {
|
2022-06-15 01:31:56 +08:00
|
|
|
const wrapper = mount(<SkeletonItem variant="image" />)
|
2020-12-21 20:07:48 +08:00
|
|
|
|
|
|
|
expect(wrapper.find('svg').exists()).toBe(true)
|
|
|
|
})
|
|
|
|
})
|