feat: 重建 Bell GoAdmin 产品骨架 (#62)

This commit is contained in:
QiuSW
2026-08-27 18:20:40 +08:00
parent b37c350096
commit f5a3dd796b
715 changed files with 75278 additions and 0 deletions
@@ -0,0 +1,16 @@
import { shallowMount } from '@vue/test-utils'
import Hamburger from '@/components/Hamburger/index.vue'
describe('Hamburger.vue', () => {
it('toggle click', async() => {
const wrapper = shallowMount(Hamburger)
await wrapper.find('.hamburger').trigger('click')
expect(wrapper.emitted('toggleClick')).toBeTruthy()
})
it('prop isActive', async() => {
const wrapper = shallowMount(Hamburger)
await wrapper.setProps({ isActive: true })
expect(wrapper.find('.is-active').exists()).toBe(true)
await wrapper.setProps({ isActive: false })
expect(wrapper.find('.is-active').exists()).toBe(false)
})
})
@@ -0,0 +1,22 @@
import { shallowMount } from '@vue/test-utils'
import SvgIcon from '@/components/SvgIcon/index.vue'
describe('SvgIcon.vue', () => {
it('iconClass', () => {
const wrapper = shallowMount(SvgIcon, {
props: {
iconClass: 'test'
}
})
expect(wrapper.find('use').attributes().href).toBe('#icon-test')
})
it('className', async() => {
const wrapper = shallowMount(SvgIcon, {
props: {
iconClass: 'test'
}
})
expect(wrapper.classes().length).toBe(1)
await wrapper.setProps({ className: 'test' })
expect(wrapper.classes().includes('test')).toBe(true)
})
})