feat(short-drama-agent-front): 新增剧本骨架屏并优化阅读导出
This commit is contained in:
1 parent
54a381ebd3
commit
3cc65aa056
16 files changed
+792
-167
No files matched your search
@@ -30,7 +30,7 @@ import SubjectIdentityPage from '@/features/subject-identity/SubjectIdentityPage
|
||||
import { styleFixture, styleImageFixture } from '@/features/visual-style/testing/fixtures'
|
||||
import { identityFixture, identityImageFixture } from '@/features/subject-identity/testing/fixtures'
|
||||
import { getIdentitySession } from '@/features/subject-identity/model'
|
||||
import { drawerPanel, expandSections, selectControl, selectMenu } from '@/testing/naive'
|
||||
import { drawerPanel, expandSections, selectControl } from '@/testing/naive'
|
||||
import ProductionPage from '@/features/production/ProductionPage.vue'
|
||||
import { getProductionSession } from '@/features/production/model'
|
||||
|
||||
@@ -917,7 +917,7 @@ describe('工作台页面交互', () => {
|
||||
expect(fetcher.mock.calls.every(([, init]) => init?.method === 'GET')).toBe(true)
|
||||
})
|
||||
|
||||
it('拆解更多菜单位于 Tabs suffix,空快照时导出仍禁用', async () => {
|
||||
it('拆解导出图标位于 Tabs suffix,空快照时禁用且不再提供执行记录', async () => {
|
||||
wrapper = mount(BreakdownPage, {
|
||||
attachTo: document.body,
|
||||
global: { provide: { [projectContextKey as symbol]: context() }, stubs: { RouterLink: true } }
|
||||
@@ -925,13 +925,13 @@ describe('工作台页面交互', () => {
|
||||
const toolbar = wrapper.get('.result-toolbar')
|
||||
expect(toolbar.find('[aria-label="拆解结果"]').exists()).toBe(true)
|
||||
expect(toolbar.find(':scope > button').exists()).toBe(false)
|
||||
expect(toolbar.find('.n-tabs-nav__suffix [aria-label="拆解更多操作"]').exists()).toBe(true)
|
||||
await toolbar.get('.n-tabs-nav__suffix [aria-label="拆解更多操作"]').trigger('click')
|
||||
await flushPromises()
|
||||
const exportItem = [...document.querySelectorAll('.n-dropdown-option-body')].find(
|
||||
item => item.textContent?.trim() === '导出 JSON'
|
||||
)!
|
||||
expect(exportItem.className).toContain('disabled')
|
||||
const exportButton = toolbar.get<HTMLButtonElement>('.n-tabs-nav__suffix [aria-label="导出拆解结果"]')
|
||||
expect(exportButton.element.disabled).toBe(true)
|
||||
expect(exportButton.text()).toBe('')
|
||||
expect(exportButton.get('svg').attributes('width')).toBe('18')
|
||||
expect(toolbar.find('[aria-label="拆解更多操作"]').exists()).toBe(false)
|
||||
expect(wrapper.find('.history-panel').exists()).toBe(false)
|
||||
expect(wrapper.text()).not.toContain('执行记录')
|
||||
})
|
||||
|
||||
it('形态图库自动显示后端已有图片,不需要再次生图;筛选只改变显示', async () => {
|
||||
@@ -1613,13 +1613,17 @@ describe('工作台页面交互', () => {
|
||||
expect(provided.refresh).toHaveBeenCalledOnce()
|
||||
})
|
||||
|
||||
it('切换剧本标签保留阅读容器和位置,执行记录按需展开', async () => {
|
||||
it('切换剧本标签保留阅读容器和位置,右侧只保留直接导出', async () => {
|
||||
wrapper = mount(CreateDramaPage, {
|
||||
attachTo: document.body,
|
||||
global: { provide: { [projectContextKey as symbol]: context() }, stubs: { RouterLink: true } }
|
||||
})
|
||||
const suffix = wrapper.get('.script-section .n-tabs-nav__suffix')
|
||||
expect(suffix.findAll('button').map(item => item.attributes('aria-label'))).toEqual(['剧本更多操作'])
|
||||
expect(suffix.findAll('button').map(item => item.text())).toEqual([''])
|
||||
expect(suffix.get('button').attributes('aria-label')).toBe('导出剧本')
|
||||
expect(suffix.get('button').classes()).toContain('icon-button')
|
||||
expect(suffix.findAll('svg')).toHaveLength(1)
|
||||
expect(suffix.get('svg').attributes('width')).toBe('18')
|
||||
expect(suffix.find('router-link-stub').exists()).toBe(false)
|
||||
expect(suffix.text()).not.toContain('进入拆解')
|
||||
const reader = wrapper.get<HTMLElement>('.reader-scroll .n-scrollbar-container').element
|
||||
@@ -1637,11 +1641,8 @@ describe('工作台页面交互', () => {
|
||||
expect(wrapper.get('.episode-reader').isVisible()).toBe(true)
|
||||
expect(wrapper.get('.reader-scroll .n-scrollbar-container').element).toBe(reader)
|
||||
expect(reader.scrollTop).toBe(120)
|
||||
await selectMenu('剧本更多操作', '执行记录')
|
||||
expect(wrapper.find('.history-panel').exists()).toBe(true)
|
||||
expect(wrapper.get('.content-with-history').classes()).not.toContain('history-hidden')
|
||||
await selectMenu('剧本更多操作', '收起执行记录')
|
||||
expect(wrapper.find('.history-panel').exists()).toBe(false)
|
||||
expect(wrapper.text()).not.toContain('执行记录')
|
||||
})
|
||||
|
||||
it('剧本文本按纯文本显示,不执行模型输出的 HTML', () => {
|
||||
|
||||
Reference in new issue
Block a user