mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-21 03:19:19 +08:00
35 lines
813 B
TypeScript
35 lines
813 B
TypeScript
import Notify from "@@/components/Notify/index.vue"
|
|
import List from "@@/components/Notify/List.vue"
|
|
import { shallowMount } from "@vue/test-utils"
|
|
import { describe, expect, it } from "vitest"
|
|
|
|
describe("notify", () => {
|
|
it("正常渲染", () => {
|
|
const wrapper = shallowMount(Notify)
|
|
expect(wrapper.classes("notify")).toBe(true)
|
|
})
|
|
})
|
|
|
|
describe("list", () => {
|
|
it("list 长度为 0", () => {
|
|
const wrapper = shallowMount(List, {
|
|
props: {
|
|
data: []
|
|
}
|
|
})
|
|
expect(wrapper.find("el-empty-stub").exists()).toBe(true)
|
|
})
|
|
it("list 长度不为 0", () => {
|
|
const wrapper = shallowMount(List, {
|
|
props: {
|
|
data: [
|
|
{
|
|
title: ""
|
|
}
|
|
]
|
|
}
|
|
})
|
|
expect(wrapper.find("el-empty-stub").exists()).toBe(false)
|
|
})
|
|
})
|