fix(short-drama-agent-front): 优化选角抽屉与操作文案
This commit is contained in:
1 parent
a8ecf37e78
commit
81d6a85260
5 files changed
+103
-68
No files matched your search
@@ -77,10 +77,9 @@ describe('管理后台组件边界', () => {
|
||||
expect(all).toMatch(/\.image-history\.n-scrollbar\s*\{[^}]*max-width:\s*100%;[^}]*min-width:\s*0/)
|
||||
expect(all).toMatch(/\.image-history-content\s*\{[^}]*display:\s*flex;[^}]*width:\s*max-content/)
|
||||
})
|
||||
it('选角面板保留说明间距,卡片按可用宽度排列并覆盖按钮默认高度', () => {
|
||||
it('选角卡片按可用宽度排列并覆盖按钮默认高度', () => {
|
||||
// 保护间距与换行契约,真实宽高和暗色效果仍需浏览器验收。
|
||||
const css = readAllStyles()
|
||||
expect(css).toMatch(/\.identity-tools-intro\s*\{[^}]*margin-bottom:\s*24px/)
|
||||
expect(css).toMatch(
|
||||
/\.casting-list\s*\{[^}]*repeat\(auto-fit, minmax\(min\(100%, 260px\), 1fr\)\);[^}]*gap:\s*12px;[^}]*margin-top:\s*24px/
|
||||
)
|
||||
|
||||
@@ -326,7 +326,7 @@ describe('身份图与母版契约', () => {
|
||||
module: 'character',
|
||||
forms: []
|
||||
})
|
||||
expect(castingStatusLabel('candidate_pending')).toBe('等待确认演员')
|
||||
expect(castingStatusLabel('candidate_pending')).toBe('待确认选角')
|
||||
})
|
||||
|
||||
it('辅助视角传递明确参考图、目录尺寸和本次 Prompt,不传旧宽高字段', async () => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { preparationFixture } from '../storyboard-preparation/fixtures'
|
||||
import { generationProfile, imageCatalog } from '../../fixtures/generation'
|
||||
import { routerLinkStubs } from '../../fixtures/router'
|
||||
import { computed, ref } from 'vue'
|
||||
import { NImage, NRadioGroup, NScrollbar } from 'naive-ui'
|
||||
import { NDrawer, NImage, NRadioGroup, NScrollbar } from 'naive-ui'
|
||||
import { createMemoryHistory, createRouter, type RouteRecordRaw } from 'vue-router'
|
||||
import { DOMWrapper, flushPromises, mount, type VueWrapper } from '@vue/test-utils'
|
||||
import { afterEach, describe, expect, it, vi, type Mock } from 'vitest'
|
||||
@@ -732,7 +732,7 @@ describe('视觉风格与主体身份工作区', () => {
|
||||
})
|
||||
stubFetch(fetcher)
|
||||
await mountAssets('identity')
|
||||
await drawerPanel().get('.n-card-header__close').trigger('click')
|
||||
await drawerPanel().get('.n-drawer-header__close').trigger('click')
|
||||
await flushPromises()
|
||||
const items = wrapper!.findAll('.identity-subject-item')
|
||||
expect(items).toHaveLength(3)
|
||||
@@ -1073,11 +1073,11 @@ describe('视觉风格与主体身份工作区', () => {
|
||||
})
|
||||
stubFetch(fetcher)
|
||||
await mountAssets('identity')
|
||||
await confirmGeneration('补齐全部主体身份文本')
|
||||
await confirmGeneration('补齐全部主体身份描述')
|
||||
const post = fetcher.mock.calls.find(([, init]) => init?.method === 'POST')!
|
||||
expect(post[0]).toBe('/api/projects/page-test-project/subject-identities/generate')
|
||||
expect(JSON.parse(post[1]!.body as string)).toEqual({ force: false, concurrency: 3 })
|
||||
expect(drawerPanel().text()).toContain('本次存在部分失败')
|
||||
expect(drawerPanel().text()).toContain('部分生成未完成')
|
||||
expect(drawerPanel().text()).toContain('含锁定 1')
|
||||
expect(drawerPanel().text()).toContain('文本模型超时')
|
||||
})
|
||||
@@ -1167,7 +1167,7 @@ describe('视觉风格与主体身份工作区', () => {
|
||||
expect(anchorImage.props()).toMatchObject({ objectFit: 'cover', previewDisabled: false })
|
||||
})
|
||||
|
||||
it('选角进度卡片分层显示长姓名、编号和状态,点击仍按正式 ID 切换主体', async () => {
|
||||
it('全屏选角卡片显示长姓名、编号和状态,关闭动画结束后按正式 ID 切换主体', async () => {
|
||||
const longName = '来自记忆当铺的另一条时间线中尚未丢失记忆的林默'
|
||||
const items = [
|
||||
{
|
||||
@@ -1211,7 +1211,8 @@ describe('视觉风格与主体身份工作区', () => {
|
||||
})
|
||||
stubFetch(fetcher)
|
||||
await mountAssets('identity')
|
||||
expect(drawerPanel().get('.identity-tools-intro').text()).toContain('为同一个人物、场景或道具固定稳定特征')
|
||||
expect(drawerPanel().text()).toContain('先保存人物、场景或道具的固定特征')
|
||||
expect(wrapper!.getComponent(NDrawer).props('width')).toBe('100vw')
|
||||
const cards = drawerPanel().get('[aria-label="角色选角进度"]').findAll('.casting-item')
|
||||
expect(cards).toHaveLength(2)
|
||||
expect(cards[0]!.get('.casting-item-name').text()).toBe(longName)
|
||||
@@ -1219,12 +1220,15 @@ describe('视觉风格与主体身份工作区', () => {
|
||||
expect(cards[0]!.get('.casting-item-status').text()).toBe('选角已完成')
|
||||
expect(cards[0]!.find('.truncate').exists()).toBe(false)
|
||||
expect(cards[0]!.attributes('aria-pressed')).toBe('true')
|
||||
expect(cards[1]!.get('.casting-item-status').text()).toBe('等待确认演员')
|
||||
expect(cards[1]!.get('.casting-item-status').text()).toBe('待确认选角')
|
||||
await cards[1]!.trigger('click')
|
||||
await flushPromises()
|
||||
expect(cards[0]!.attributes('aria-pressed')).toBe('false')
|
||||
expect(cards[1]!.attributes('aria-pressed')).toBe('true')
|
||||
expect(cards[1]!.classes()).toContain('selected')
|
||||
expect(wrapper!.getComponent(NDrawer).props('show')).toBe(false)
|
||||
expect(wrapper!.findAll('.identity-subject-item')[0]!.attributes('aria-pressed')).toBe('true')
|
||||
/** DOM 环境不播放离场动画,显式交接公共抽屉的关闭完成事件。 */
|
||||
wrapper!.getComponent(NDrawer).vm.$emit('after-leave')
|
||||
await flushPromises()
|
||||
expect(wrapper!.findAll('.identity-subject-item')[1]!.attributes('aria-pressed')).toBe('true')
|
||||
expect(new DOMWrapper(document.body).get<HTMLTextAreaElement>('#identity-description').element.value).toBe(
|
||||
'老周的稳定身份'
|
||||
)
|
||||
@@ -1278,7 +1282,7 @@ describe('视觉风格与主体身份工作区', () => {
|
||||
})
|
||||
stubFetch(fetcher)
|
||||
await mountAssets('identity')
|
||||
expect(wrapper!.text()).toContain('等待确认演员')
|
||||
expect(wrapper!.text()).toContain('待确认选角')
|
||||
expect(wrapper!.find('.identity-anchor-grid').exists()).toBe(true)
|
||||
button('确认选角并锁定').click()
|
||||
await flushPromises()
|
||||
|
||||
Reference in new issue
Block a user