fix(short-drama-agent-front): 修复代码格式检查问题

This commit is contained in:
GJ committed 2026-10-21 17:04:02 +08:00
1 parent 81d6a85260
commit 48fce3975f
87 files changed
+5714 -1436

No files matched your search

+44 -6
View File
@@ -150,11 +150,21 @@ function server() {
else if (path.endsWith('/checkpoints')) data = context.checkpoints.value
else if (path.endsWith('/subject-forms')) data = [form]
else if (path.endsWith('/production/entry-readiness')) data = { ready: true, derivedAssets: { shotCount: 1 } }
else if (path.includes('/storyboard-visual-states')) data = { ...directionsResult('capability-test', Number(new URL(String(url), 'http://localhost').searchParams.get('episodeNo') || 1)), shotCount: 1, visualStateCount: 1, staleCount: 0 }
else if (path.includes('/storyboard-visual-states'))
data = {
...directionsResult(
'capability-test',
Number(new URL(String(url), 'http://localhost').searchParams.get('episodeNo') || 1)
),
shotCount: 1,
visualStateCount: 1,
staleCount: 0
}
else if (path.endsWith('/production/plan')) data = plan
else if (path.endsWith('/production/status')) data = status
else if (path.includes('/readiness')) data = readiness
else if (path.includes('/storyboard-directions')) data = { ...directionsResult('capability-test'), shotCount: 1, directionCount: 1 }
else if (path.includes('/storyboard-directions'))
data = { ...directionsResult('capability-test'), shotCount: 1, directionCount: 1 }
else if (path.endsWith('/videos/status'))
data = {
total: 1,
@@ -216,7 +226,9 @@ describe('高级串联生产的安全边界', () => {
const openSettings = vi.fn<() => void>()
wrapper = mount(AdvancedProduction, {
attachTo: document.body,
global: { provide: { [projectContextKey as symbol]: context, [projectSettingsOpenKey as symbol]: openSettings } }
global: {
provide: { [projectContextKey as symbol]: context, [projectSettingsOpenKey as symbol]: openSettings }
}
})
await flushPromises()
await expandSections()
@@ -231,7 +243,30 @@ describe('高级串联生产的安全边界', () => {
})
it('配置在预检期间缺失时显示明确阻断,不读取空阶段或允许启动', async () => {
const { service, posts } = await advanced()
vi.spyOn(productionApi, 'plan').mockResolvedValue({ projectId: 'capability-test', canStart: false, canAutoRun: false, hasManualBlockers: true, manualBlocked: 1, configuration: { status: 'blocked', code: 'CREATIVE_PROFILE_REQUIRED', reason: '项目尚未配置 Creative Profile,请先保存项目生成配置' }, entryReadiness: { ready: true }, providers: null, generationConfig: null, completed: false, stage: 'configuration_required', characterIdentity: null, stableIdentityAnchors: null, subjectImages: null, keyframes: null, videoPrompts: null, videos: null, details: null })
vi.spyOn(productionApi, 'plan').mockResolvedValue({
projectId: 'capability-test',
canStart: false,
canAutoRun: false,
hasManualBlockers: true,
manualBlocked: 1,
configuration: {
status: 'blocked',
code: 'CREATIVE_PROFILE_REQUIRED',
reason: '项目尚未配置 Creative Profile,请先保存项目生成配置'
},
entryReadiness: { ready: true },
providers: null,
generationConfig: null,
completed: false,
stage: 'configuration_required',
characterIdentity: null,
stableIdentityAnchors: null,
subjectImages: null,
keyframes: null,
videoPrompts: null,
videos: null,
details: null
})
await service.preflight()
expect(service.check.value).toBeNull()
expect(service.error.value).toContain('请先保存项目生成配置')
@@ -243,8 +278,11 @@ describe('高级串联生产的安全边界', () => {
const { service, fetcher, posts } = await advanced()
const original = fetcher.getMockImplementation()!
let missing = true
fetcher.mockImplementation((url, init) => missing && String(url).endsWith('/creative-profile')
? Promise.resolve(new Response('{"data":null}')) : original(url, init))
fetcher.mockImplementation((url, init) =>
missing && String(url).endsWith('/creative-profile')
? Promise.resolve(new Response('{"data":null}'))
: original(url, init)
)
await service.preflight()
expect(service.configurationRequired.value).toBe(true)
expect(service.check.value).toBeNull()