feat: 统一图片铺满展示与原生预览
This commit is contained in:
@@ -525,6 +525,10 @@ describe('视觉风格与主体身份工作区', () => {
|
||||
'/api/subjects/subject-db-1/identity/images/candidate/anchor'
|
||||
)
|
||||
expect(wrapper!.text()).toContain('当前身份母版')
|
||||
const anchorImage = wrapper!
|
||||
.findAllComponents(NImage)
|
||||
.find(image => image.props('alt')?.endsWith('当前身份母版'))!
|
||||
expect(anchorImage.props()).toMatchObject({ objectFit: 'cover', previewDisabled: false })
|
||||
})
|
||||
|
||||
it('选角进度卡片分层显示长姓名、编号和状态,点击仍按正式 ID 切换主体', async () => {
|
||||
@@ -874,6 +878,41 @@ describe('工作台页面交互', () => {
|
||||
expect(wrapper!.find('.form-image-card img').exists()).toBe(true)
|
||||
expect(button('补齐项目主参考图').disabled).toBe(true)
|
||||
})
|
||||
it('分镜参考图使用 cover 和原生预览,查看图片不触发生成功能', async () => {
|
||||
const shot = designedShot()
|
||||
const fetcher = vi.fn<typeof fetch>().mockResolvedValue(
|
||||
jsonResponse({
|
||||
shotId: shot.shotId,
|
||||
references: [
|
||||
{
|
||||
shotSubjectId: 'binding-db',
|
||||
subjectId: 'subject-db',
|
||||
subjectRef: '@CH0001',
|
||||
subjectName: '林知夏',
|
||||
module: 'character',
|
||||
subjectFormId: 'form-db',
|
||||
subjectFormName: '日常',
|
||||
imageId: 'image-db',
|
||||
imageUrl: '/storage/reference.png'
|
||||
}
|
||||
],
|
||||
missing: []
|
||||
})
|
||||
)
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
wrapper = mount(ShotTools, { attachTo: document.body, props: { projectId: fixture.id, shot, disabled: false } })
|
||||
button('读取参考图').click()
|
||||
await flushPromises()
|
||||
expect(wrapper.getComponent(NImage).props()).toMatchObject({ objectFit: 'cover', previewDisabled: false })
|
||||
const image = wrapper.get('.reference-card img')
|
||||
expect(image.element.parentElement?.closest('a')).toBeNull()
|
||||
await image.trigger('click')
|
||||
await flushPromises()
|
||||
expect(document.querySelector('.n-image-preview')?.getAttribute('src')).toBe(image.attributes('src'))
|
||||
expect(fetcher.mock.calls).toHaveLength(1)
|
||||
expect(fetcher.mock.calls.every(([, init]) => !init?.method || init.method === 'GET')).toBe(true)
|
||||
})
|
||||
|
||||
it('参考图拦截危险地址,生成规格只通过 GET 读取正式形态和状态', async () => {
|
||||
const shot = designedShot()
|
||||
const fetcher = vi
|
||||
|
||||
Reference in New Issue
Block a user