feat(short-drama-agent-front): 优化分镜界面并新增弹窗手势

This commit is contained in:
GJ committed 2026-11-18 18:50:15 +08:00
1 parent b15a6011ce
commit d68f03471c
59 files changed
+2694 -857

No files matched your search

@@ -7,9 +7,27 @@ import KeyframeValidationHistory from '@/features/production/components/Keyframe
import { additionalImageFixture } from '../../fixtures/image-additional'
import { AssetImage } from '@/components/ui'
import { keyframeFixture } from '@/features/production/testing/fixtures'
import { keyframeDisplayNames } from '@/features/production/model'
import { imagePreviewFixture } from '../../fixtures/image-preview'
describe('V8-10免费输入与独立门禁', () => {
it('图片名称按原创建时间编号,倒序与主图切换仍使用相同名称', () => {
const old = keyframeFixture({ id: 'old', createdAt: '2026-11-01T00:00:00Z', isPrimary: false }),
recent = keyframeFixture({ id: 'recent', createdAt: '2026-11-02T00:00:00Z', isPrimary: true })
const names = keyframeDisplayNames([recent, old], '午后收整工具', 1)
expect(names.get('old')).toBe('午后收整工具 · 图片 01')
expect(names.get('recent')).toBe('午后收整工具 · 图片 02')
expect(
keyframeDisplayNames(
[
{ ...old, isPrimary: true },
{ ...recent, isPrimary: false }
],
'午后收整工具',
1
)
).toEqual(names)
})
it('旧图片按需查看原费用与来源,切换项目/候选后不混入其它记录或未执行计划', async () => {
const fetcher = vi.fn<typeof fetch>(async url => {
const path = String(url)
@@ -17,11 +35,12 @@ describe('V8-10免费输入与独立门禁', () => {
const projectId = path.includes('/second-project/') ? 'second-project' : 'original-project',
list = additionalImageFixture(projectId)
list.requests[0]!.input.targetId = 'history-shot'
list.requests[0]!.input.model = '原图片实际型号'
list.requests[0]!.input.candidateId = projectId === 'second-project' ? 'second-image' : 'old-image'
list.requests.push({
...structuredClone(list.requests[0]!),
id: 'another-candidate-request',
input: { ...list.requests[0]!.input, candidateId: 'unrelated-image' }
input: { ...list.requests[0]!.input, candidateId: 'unrelated-image', model: '其它图片的型号' }
})
return Response.json({ data: list })
}
@@ -59,6 +78,9 @@ describe('V8-10免费输入与独立门禁', () => {
.trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('原预留 USD 0.5')
expect(wrapper.text()).toContain('原图片实际型号')
expect(wrapper.text()).not.toContain('其它图片的型号')
expect(wrapper.findAll('[aria-label="原图片生成记录"]')).toHaveLength(1)
expect(wrapper.text()).toContain('实际账单 未知')
expect(wrapper.text()).toContain('历史审核未通过,当前来源已变化')
expect(wrapper.text()).not.toContain('another-candidate-request')
@@ -104,7 +126,9 @@ describe('V8-10免费输入与独立门禁', () => {
id: 'old-image',
shotId: 'quality-shot',
isPrimary: true,
imageUrl: '/mock.png'
imageUrl: '/mock.png',
model: '仅供详情核对的原型号',
error: '这份很长的历史错误只应在详情中展示'
}),
projectId: 'quality-project',
shotId: 'quality-shot',
@@ -113,11 +137,21 @@ describe('V8-10免费输入与独立门禁', () => {
blocked: true,
validationPassed: true,
confirming: false,
readonly: true
}
readonly: true,
displayName: '午后收整工具 · 图片 01'
},
global: { stubs: { teleport: true } }
})
try {
await flushPromises()
expect(wrapper.get('.keyframe-card-name').text()).toBe('午后收整工具 · 图片 01')
expect(wrapper.text()).not.toContain('这份很长的历史错误')
expect(wrapper.text()).not.toContain('仅供详情核对的原型号')
expect(wrapper.text()).toContain('审核来源过期')
await wrapper.get('button[aria-label="查看首帧详情"]').trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('这份很长的历史错误只应在详情中展示')
expect(wrapper.text()).toContain('仅供详情核对的原型号')
expect(wrapper.text()).toContain(
machine === 'failed' ? '历史审核未通过,当前来源已变化' : '历史审核通过,当前来源已变化'
)