import { markRaw, nextTick, ref } from 'vue'
import { mount } from '@vue/test-utils'
import { describe, expect, it, test } from 'vitest'
import { Loading, Search } from '@element-plus/icons-vue'
import Button from '../src/button.vue'
import ButtonGroup from '../src/button-group.vue'
import type { ComponentSize } from '@element-plus/constants'
const AXIOM = 'Rem is the best girl'
describe('Button.vue', () => {
it('create', () => {
const wrapper = mount(() => )
expect(wrapper.classes()).toContain('el-button--primary')
})
it('icon', () => {
const wrapper = mount(() => )
expect(wrapper.findComponent(Search).exists()).toBeTruthy()
})
it('nativeType', () => {
const wrapper = mount(() => )
expect(wrapper.attributes('type')).toBe('submit')
})
it('loading', () => {
const wrapper = mount(() => )
expect(wrapper.classes()).toContain('is-loading')
expect(wrapper.findComponent(Loading).exists()).toBeTruthy()
})
it('size', () => {
const wrapper = mount(() => )
expect(wrapper.classes()).toContain('el-button--large')
})
it('plain', () => {
const wrapper = mount(() => )
expect(wrapper.classes()).toContain('is-plain')
})
it('round', () => {
const wrapper = mount(() => )
expect(wrapper.classes()).toContain('is-round')
})
it('circle', () => {
const wrapper = mount(() => )
expect(wrapper.classes()).toContain('is-circle')
})
it('text', async () => {
const bg = ref(false)
const wrapper = mount(() => )
expect(wrapper.classes()).toContain('is-text')
bg.value = true
await nextTick()
expect(wrapper.classes()).toContain('is-has-bg')
})
it('link', async () => {
const wrapper = mount(() => )
expect(wrapper.classes()).toContain('is-link')
})
test('render text', () => {
const wrapper = mount(() => (