feat: 同步精简接口并统一表单校验

This commit is contained in:
GJ
2026-09-10 22:34:47 +08:00
parent 82d7bde631
commit 2eea0ea72e
66 changed files with 1611 additions and 1100 deletions
@@ -414,23 +414,14 @@ describe('过期首帧到具体素材定位', () => {
await flushPromises()
expect(wrapper!.findAll('.form-image-card')).toHaveLength(3)
})
it('身份主图真的过期时显示独立顶部警告,并可从定位模式筛选所有过期素材', async () => {
it('精简图库没有历史母版字段时,不误报形态过期或破坏定位', async () => {
const { first, router } = await gallery('?subjectFormId=form-other')
first.subject.identity = { id: 'identity-1', isLocked: true, images: [{ id: 'anchor-new' }] }
const refresh = wrapper!.get('[aria-label="刷新图库"]')
await refresh.trigger('click')
first.subject.identity = { id: 'identity-1', isLocked: true, anchorImageId: 'anchor-new' }
await wrapper!.get('[aria-label="刷新图库"]').trigger('click')
await flushPromises()
expect(wrapper!.text()).toContain('形态主图需要更新')
await wrapper!
.findAll('button')
.find(button => button.text() === '筛选身份过期形态')!
.trigger('click')
await flushPromises()
expect(router.currentRoute.value.query.subjectFormId).toBeUndefined()
expect(wrapper!.findAll('.form-image-card').map(item => item.attributes('data-form-id'))).toEqual([
'form-db-1',
'form-special'
])
expect(wrapper!.text()).not.toContain('形态主图需要更新')
expect(router.currentRoute.value.query.subjectFormId).toBe('form-other')
expect(wrapper!.findAll('button').some(item => item.text() === '重新生成过期形态')).toBe(false)
})
it('仅视频接口报告过期时也显示警告,并明确两种检查不一致', async () => {
const { keyframes } = await gallery('?sourceShotId=shot-target&subjectFormId=form-special')