feat(short-drama-agent-front): 补齐首帧审核与视线修订
This commit is contained in:
1 parent
c7a6b12261
commit
0d58dd8c53
25 files changed
+1140
-30
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { validationPreview } from '../../fixtures/validation-preview'
|
||||
import { ApiError } from '@/lib/http'
|
||||
import { defineComponent, reactive, ref } from 'vue'
|
||||
import { flushPromises, mount, type VueWrapper } from '@vue/test-utils'
|
||||
@@ -37,6 +38,7 @@ afterEach(() => {
|
||||
|
||||
/** 模拟统一配置后的真实契约,测试绝不调用真实图片或视觉模型。 */
|
||||
function server() {
|
||||
const plan = structuredClone(validationPreview)
|
||||
const projectId = `quality-test-${sequence++}`
|
||||
const project = testProjectContext(projectId).project.value!
|
||||
const validation = {
|
||||
@@ -164,6 +166,7 @@ function server() {
|
||||
}
|
||||
else if (String(url).endsWith('/checkpoints?view=summary')) data = []
|
||||
else if (path.endsWith('/production/entry-readiness')) data = { ready: true }
|
||||
else if (path.endsWith('/validate/preview')) data = plan
|
||||
else if (path.endsWith('/validations')) data = []
|
||||
else if (path.endsWith('/quality-review'))
|
||||
data = {
|
||||
@@ -191,6 +194,7 @@ function server() {
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
return {
|
||||
projectId,
|
||||
plan,
|
||||
project,
|
||||
validation,
|
||||
keyframe,
|
||||
@@ -461,8 +465,9 @@ describe('质量面板渐进展示', () => {
|
||||
})
|
||||
await flushPromises()
|
||||
expect(validationButton().disabled).toBe(true)
|
||||
expect(document.body.textContent).toContain('更多参数与模型限制')
|
||||
expect(document.querySelector('[aria-label="额外允许的画面文字"]')).not.toBeNull()
|
||||
expect(document.body.textContent).toContain('免费审核预检')
|
||||
expect(document.body.textContent).toContain('未知,需先核对费用范围')
|
||||
expect(document.querySelector('[aria-label="额外允许的画面文字"]')).toBeNull()
|
||||
expect(data.posts()).toHaveLength(0)
|
||||
wrapper.findAllComponents(NCheckbox).at(-1)!.vm.$emit('update:checked', true)
|
||||
await flushPromises()
|
||||
@@ -639,3 +644,47 @@ describe('视频修复候选与复检晋升', () => {
|
||||
expect(data.posts()).toHaveLength(0)
|
||||
})
|
||||
})
|
||||
|
||||
describe('普通审核计划保护', () => {
|
||||
it.each(['blocked', 'reusable'] as const)('%s 不允许新审核且不自动收费', async status => {
|
||||
const data = server()
|
||||
data.plan.status = status
|
||||
if (status === 'reusable') data.plan.reusableResult = { passed: false, summary: '旧失败结论' }
|
||||
else data.plan.activeTasks = [{ status: 'running' }]
|
||||
wrapper = mount(QualityDialog, {
|
||||
attachTo: document.body,
|
||||
props: {
|
||||
projectId: data.projectId,
|
||||
target: { kind: 'keyframe', shotId: 'shot-1', assetId: 'keyframe-1', title: '计划保护' },
|
||||
open: true,
|
||||
disabled: false
|
||||
}
|
||||
})
|
||||
await flushPromises()
|
||||
wrapper.findAllComponents(NCheckbox).at(-1)!.vm.$emit('update:checked', true)
|
||||
await flushPromises()
|
||||
expect(validationButton().disabled).toBe(true)
|
||||
expect(data.posts()).toHaveLength(0)
|
||||
expect(document.body.textContent).toContain(status === 'reusable' ? '历史审核:未通过' : '正在执行')
|
||||
})
|
||||
it('批准后计划变化撤销提交,刷新后等待重新确认', async () => {
|
||||
const data = server()
|
||||
wrapper = mount(QualityDialog, {
|
||||
attachTo: document.body,
|
||||
props: {
|
||||
projectId: data.projectId,
|
||||
target: { kind: 'keyframe', shotId: 'shot-1', assetId: 'keyframe-1', title: '计划保护' },
|
||||
open: true,
|
||||
disabled: false
|
||||
}
|
||||
})
|
||||
await flushPromises()
|
||||
wrapper.findAllComponents(NCheckbox).at(-1)!.vm.$emit('update:checked', true)
|
||||
await flushPromises()
|
||||
data.plan.validationFingerprint = 'b'.repeat(64)
|
||||
validationButton().click()
|
||||
await flushPromises()
|
||||
expect(data.posts()).toHaveLength(0)
|
||||
expect(validationButton().disabled).toBe(true)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user