This commit is contained in:
2026-09-15 09:58:15 +08:00
parent 3f998bdb88
commit 4bf66d9571
90 changed files with 1599 additions and 1388 deletions
@@ -28,13 +28,14 @@ describe('BatchImportDialog', () => {
vi.unstubAllGlobals()
})
it('uses the shared two-step flow and submits a validated XLSX file', async () => {
it.each([false, true])('uses the shared two-step flow and submits a validated XLSX file (dense: %s)', async (dense) => {
vi.stubGlobal('ResizeObserver', ResizeObserverStub)
const result: BatchImportResult = {
fileName: 'partners.xlsx', totalRows: 2, importedRows: 2, success: true, errors: [],
}
const importFile = vi.fn().mockResolvedValue(result)
const wrapper = mount(BatchImportDialog, {
attrs: { class: dense ? 'admin-density-dialog' : undefined },
attachTo: document.body,
props: {
modelValue: true,
@@ -48,6 +49,7 @@ describe('BatchImportDialog', () => {
})
await flushPromises()
expect(document.querySelector('.batch-import-dialog')?.classList.contains('admin-density-dialog')).toBe(dense)
expect(document.body.textContent).toContain('下载标准模板')
expect(document.body.textContent).toContain('选择填写后的文件')
expect(button('开始导入')?.hasAttribute('disabled')).toBe(true)