fix(short-drama-agent-front): 优化项目操作与形态图库

This commit is contained in:
GJ committed 2026-11-06 23:02:33 +08:00
1 parent 27ee9fd4ff
commit dbf97e6f98
11 files changed
+175 -109

No files matched your search

+4 -2
View File
@@ -33,10 +33,12 @@ describe('资源图片展示与原图预览', () => {
expect(wrapper.get<HTMLImageElement>('img').element.style.objectFit).toBe('contain')
})
it('图片加载前显示轻量骨架占位,加载完成后直接淡入图片并移除占位', async () => {
it('图片加载时显示无文字的占位图标,完成后展示原图', async () => {
wrapper = mount(AssetImage, { props: { src: '/storage/reveal.png', alt: '加载中的图片' } })
expect(wrapper.get('.reveal-image').attributes('aria-busy')).toBe('true')
expect(wrapper.find('.reveal-image-placeholder').exists()).toBe(true)
const placeholder = wrapper.get('.reveal-image-placeholder')
expect(placeholder.find('svg').exists()).toBe(true)
expect(placeholder.text()).toBe('')
expect(wrapper.find('.reveal-image-grid').exists()).toBe(false)
await wrapper.get('img').trigger('load')
expect(wrapper.get('.reveal-image').classes()).toContain('is-loaded')
+8 -4
View File
@@ -529,10 +529,14 @@ describe('管理后台组件边界', () => {
expect(wrapper.get('.project-view .workspace-page').text()).toBe(path)
}
expect(detail).toHaveBeenCalledOnce()
expect(wrapper.findAll('.project-header .n-button').map(button => button.text())).toEqual([
'制作前检查',
'项目配置'
])
const menuButton = wrapper.get('.project-header button[aria-label="项目操作"]')
expect(wrapper.findAll('.project-header .n-button')).toHaveLength(1)
await menuButton.trigger('click')
await flushPromises()
expect(menuButton.attributes('aria-expanded')).toBe('true')
expect(
[...document.querySelectorAll('.n-dropdown-option-body')].map(option => option.textContent?.trim())
).toEqual(['制作前检查', '项目配置'])
expect(wrapper.find('.project-header [aria-label="刷新项目"]').exists()).toBe(false)
expect(wrapper.find('.project-header .n-tag').exists()).toBe(false)
})