test: add vitest config and unit tests

This commit is contained in:
2026-05-27 23:28:41 +08:00
parent f35f73dca0
commit 13846a0b61
13 changed files with 1087 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
import { vi } from 'vitest'
// Mock Element Plus components globally
vi.mock('element-plus', () => ({
ElMessage: {
success: vi.fn(),
error: vi.fn(),
warning: vi.fn(),
info: vi.fn(),
},
ElMessageBox: {
confirm: vi.fn().mockResolvedValue('confirm'),
},
}))