import { nextTick, ref } from 'vue'
import { mount } from '@vue/test-utils'
import { describe, expect, test } from 'vitest'
import { CircleClose } from '@element-plus/icons-vue'
import Progress from '../src/progress.vue'
describe('Progress.vue', () => {
test('percent', () => {
const wrapper = mount(() => )
expect(wrapper.find('.el-progress__text').text()).toBe('66%')
expect(wrapper.find('.el-progress-bar__inner').attributes('style')).toBe(
'width: 66%; animation-duration: 3s;'
)
})
test('status', () => {
const wrapper = mount(() => )
expect(wrapper.classes()).toContain('is-exception')
expect(wrapper.findComponent(CircleClose).exists()).toBe(true)
})
test('text inside', () => {
const wrapper = mount(() => )
expect(wrapper.classes()).toContain('el-progress--text-inside')
})
test('stroke width', () => {
const wrapper = mount(() => )
expect(wrapper.find('.el-progress-bar__outer').attributes('style')).toBe(
'height: 7px;'
)
})
test('show text', () => {
const wrapper = mount(() => )
expect(wrapper.find('.el-progress__text').exists()).toBe(false)
})
test('circle', () => {
const wrapper = mount(() => )
expect(wrapper.classes()).toContain('el-progress--circle')
})
test('dashboard', () => {
const wrapper = mount(() => )
expect(wrapper.classes()).toContain('el-progress--dashboard')
})
test('width', () => {
const wrapper = mount(() => )
expect(wrapper.find('.el-progress-circle').attributes('style')).toBe(
'height: 120px; width: 120px;'
)
})
test('color', () => {
const wrapper = mount(() => )
expect(
wrapper.find('.el-progress-bar__inner').attributes('style')
).toContain('background-color: rgb(255, 255, 255);')
})
test('color is function', async () => {
const percentage = ref(0)
const wrapper = mount(() => (