feat(short-drama-agent-front): 补齐后端生产与质量功能
This commit is contained in:
1 parent
967c4ebea1
commit
470b52e26d
52 files changed
+3754
-1075
No files matched your search
@@ -40,9 +40,7 @@ describe('WorkflowExecution 前端契约', () => {
|
||||
|
||||
it('刷新页面后使用保存的 executionId 读取后端权威状态', async () => {
|
||||
localStorage.setItem('short-drama:workflow-execution:project-1:video-quality', 'execution-1')
|
||||
const fetcher = vi.fn<typeof fetch>().mockResolvedValue(
|
||||
new Response(JSON.stringify({ data: execution() }))
|
||||
)
|
||||
const fetcher = vi.fn<typeof fetch>().mockResolvedValue(new Response(JSON.stringify({ data: execution() })))
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
const scope = effectScope()
|
||||
const tracker = scope.run(() => useWorkflowExecution(ref('project-1'), 'video-quality'))!
|
||||
@@ -50,6 +48,11 @@ describe('WorkflowExecution 前端契约', () => {
|
||||
expect(fetcher.mock.calls[0]?.[0]).toBe('/api/workflow-executions/execution-1')
|
||||
expect(tracker.query.data.value?.stage).toBe('validating')
|
||||
tracker.dismiss()
|
||||
expect(localStorage.getItem('short-drama:workflow-execution:project-1:video-quality')).toBe('execution-1')
|
||||
expect(tracker.active.value).toBe(true)
|
||||
fetcher.mockResolvedValue(new Response(JSON.stringify({ data: execution({ status: 'completed' }) })))
|
||||
await tracker.query.refresh()
|
||||
tracker.dismiss()
|
||||
expect(localStorage.getItem('short-drama:workflow-execution:project-1:video-quality')).toBeNull()
|
||||
scope.stop()
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user