import { describe, it, expect, vi, beforeEach } from 'vitest' import { mount } from '@vue/test-utils' import ImportDataModal from '@/components/admin/account/ImportDataModal.vue' const showError = vi.fn() const showSuccess = vi.fn() vi.mock('@/stores/app', () => ({ useAppStore: () => ({ showError, showSuccess }) })) vi.mock('@/api/admin', () => ({ adminAPI: { accounts: { importData: vi.fn() } } })) vi.mock('vue-i18n', () => ({ useI18n: () => ({ t: (key: string) => key }) })) describe('ImportDataModal', () => { beforeEach(() => { showError.mockReset() showSuccess.mockReset() }) it('未选择文件时提示错误', async () => { const wrapper = mount(ImportDataModal, { props: { show: true }, global: { stubs: { BaseDialog: { template: '