feat: 完成 UI 基础层与核心页面迁移

This commit is contained in:
Wxw-Gu
2026-08-19 17:43:07 +08:00
parent a72ae49e2c
commit e9cc996ebb
62 changed files with 4279 additions and 5178 deletions
+20
View File
@@ -31,6 +31,7 @@ describe('ExportWorkspace multi-chat selection', () => {
onExportProgress: vi.fn(() => vi.fn()),
getVoiceModelStatus: vi.fn().mockRejectedValue(new Error('fixture model unavailable')),
getGroupSnapshot: vi.fn(async () => ({ members: [] })),
selectExportDirectory: vi.fn(async () => ({ canceled: false, path: '/fixture/export' })),
cancelExport: vi.fn(async () => ({ success: true })),
revealExport: vi.fn(async () => ({ success: true }))
}
@@ -197,6 +198,25 @@ describe('ExportWorkspace multi-chat selection', () => {
expect(document.querySelector('.export-all-chat-avatar.user')).not.toBeInTheDocument()
expect(loadPreviewMessages).not.toHaveBeenCalled()
})
it('keeps custom dates and output directory selection in the workspace request', async () => {
const onStartExport = vi.fn(async () => ({ success: false }))
renderWorkspace(onStartExport)
await userEvent.click(screen.getByRole('button', { name: '自定义时间' }))
await userEvent.type(screen.getByLabelText('开始时间'), '2026-08-01T09:30')
await userEvent.type(screen.getByLabelText('结束时间'), '2026-08-02T18:45')
await userEvent.click(screen.getByRole('button', { name: '选择位置' }))
expect(await screen.findByText('/fixture/export/聊天 A_聊天档案.csv')).toBeVisible()
await userEvent.click(screen.getByRole('button', { name: '开始导出' }))
await waitFor(() => expect(onStartExport).toHaveBeenCalledOnce())
expect(onStartExport.mock.calls[0][0]).toMatchObject({
outputDirectory: '/fixture/export',
startTime: Math.floor(new Date('2026-08-01T09:30').getTime() / 1000),
endTime: Math.floor(new Date('2026-08-02T18:45').getTime() / 1000)
})
})
})
describe('ExportTaskCenter details', () => {