fix(short-drama-agent-front): 优化项目操作与形态图库
This commit is contained in:
1 parent
27ee9fd4ff
commit
dbf97e6f98
11 files changed
+175
-109
No files matched your search
@@ -8,9 +8,10 @@ afterEach(() => vi.unstubAllGlobals())
|
||||
|
||||
describe('道具与场景来源诊断', () => {
|
||||
it.each([
|
||||
['missing', '尚未准备结构规格'],
|
||||
['stale', '结构来源已过期']
|
||||
])('道具 %s 只读取原文和历史,不调用生成', async (status, label) => {
|
||||
['missing', '尚未准备结构规格', null, false],
|
||||
['stale', '结构来源已过期', 'failed', false],
|
||||
['stale', '结构来源已过期', 'completed', true]
|
||||
])('道具 %s 只读取原文和历史,不调用生成', async (status, label, attemptStatus, canReuse) => {
|
||||
const form = formFixture('source-project')
|
||||
form.subject.module = 'prop'
|
||||
const fetcher = vi.fn<typeof fetch>(
|
||||
@@ -35,8 +36,8 @@ describe('道具与场景来源诊断', () => {
|
||||
relationQuote: '搭扣从工具箱脱落'
|
||||
}
|
||||
],
|
||||
lastGenerationAttempt: {
|
||||
status: 'failed',
|
||||
lastGenerationAttempt: attemptStatus && {
|
||||
status: attemptStatus,
|
||||
sourceCurrent: false,
|
||||
error: '无法核对归属',
|
||||
evidence: { candidates: [{ semanticClass: '工具箱' }] },
|
||||
@@ -56,7 +57,8 @@ describe('道具与场景来源诊断', () => {
|
||||
expect(wrapper.text()).toContain(label)
|
||||
expect(wrapper.text()).toContain('数量来源 · 第 1 集')
|
||||
expect(wrapper.text()).toContain('拆装来源 · 第 2 集')
|
||||
expect(wrapper.text()).toContain('准备时的来源已过期')
|
||||
expect(wrapper.text().includes('准备时的来源已过期')).toBe(Boolean(attemptStatus))
|
||||
expect(wrapper.findAll('button').some(button => button.text() === '免费复用已有规格')).toBe(canReuse)
|
||||
expect(fetcher.mock.calls).toHaveLength(1)
|
||||
expect(fetcher.mock.calls[0]?.[1]?.method).toBe('GET')
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user