优化
This commit is contained in:
@@ -101,6 +101,30 @@ describe('DownloadCenterView', () => {
|
||||
expect(retryPlatformExportTask).toHaveBeenCalledWith('9')
|
||||
})
|
||||
|
||||
it('labels and retries Finance tasks with their exact source export permission', async () => {
|
||||
const financeTask = {
|
||||
...task,
|
||||
exportType: 'FINANCE_RECONCILIATION_STATEMENT_LIST',
|
||||
taskName: '客户对账单',
|
||||
status: 'FAILED' as const,
|
||||
}
|
||||
vi.mocked(listPlatformExportTasks).mockResolvedValue({ records: [financeTask], page: 1, size: 20, total: 1, pages: 1 })
|
||||
const pinia = setActivePinia(createPinia())
|
||||
const auth = useAuthStore()
|
||||
auth.token = 'token'
|
||||
auth.permissions = ['platform:download:list', 'platform:finance:customer-statement:export']
|
||||
useAccessPreviewStore().initializeAfterLogin()
|
||||
mount(DownloadCenterView, { attachTo: document.body, global: { plugins: [pinia, ElementPlus] } })
|
||||
await flushPromises()
|
||||
|
||||
expect(document.body.textContent).toContain('客户对账单')
|
||||
const retry = [...document.querySelectorAll<HTMLButtonElement>('button')]
|
||||
.find((item) => item.textContent?.trim() === '重试')
|
||||
retry?.click()
|
||||
await flushPromises()
|
||||
expect(retryPlatformExportTask).toHaveBeenCalledWith('9')
|
||||
})
|
||||
|
||||
it('loads a fresh task detail from the backend', async () => {
|
||||
const wrapper = mount(DownloadCenterView, { attachTo: document.body, global: { plugins: [createPinia(), ElementPlus] } })
|
||||
await flushPromises()
|
||||
|
||||
Reference in New Issue
Block a user