feat(short-drama-agent-front): 完善镜头定位与项目配置
This commit is contained in:
1 parent
470b52e26d
commit
5b134207b8
66 files changed
+2042
-984
No files matched your search
@@ -1,10 +1,16 @@
|
||||
import { generationProfile, imageCatalog } from '../../fixtures/generation'
|
||||
import { flushPromises, mount } from '@vue/test-utils'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import QualityResult from '@/features/production/components/QualityResult.vue'
|
||||
import { expandSections } from '@/testing/naive'
|
||||
import ShotProductionAssets from '@/features/production/components/ShotProductionAssets.vue'
|
||||
import { primaryKeyframe } from '@/features/production/model'
|
||||
import { qualityKey, qualitySession, sessionKeyframePassed, sessionVideoValidation } from '@/features/production/quality'
|
||||
import {
|
||||
qualityKey,
|
||||
qualitySession,
|
||||
sessionKeyframePassed,
|
||||
sessionVideoValidation
|
||||
} from '@/features/production/quality'
|
||||
import { keyframeFixture, videoFixture } from '@/features/production/testing/fixtures'
|
||||
import { storyboardApi } from '@/features/storyboard/api'
|
||||
import { hasRunningWorkflow } from '@/features/workflows/selectors'
|
||||
@@ -64,7 +70,13 @@ describe('精简公开资产回归', () => {
|
||||
async url =>
|
||||
new Response(
|
||||
JSON.stringify({
|
||||
data: String(url).endsWith('/videos') ? [video] : []
|
||||
data: String(url).endsWith('/generation-models')
|
||||
? imageCatalog
|
||||
: String(url).endsWith('/creative-profile')
|
||||
? generationProfile(projectId)
|
||||
: String(url).endsWith('/videos')
|
||||
? [video]
|
||||
: []
|
||||
})
|
||||
)
|
||||
)
|
||||
@@ -100,7 +112,13 @@ describe('精简公开资产回归', () => {
|
||||
async url =>
|
||||
new Response(
|
||||
JSON.stringify({
|
||||
data: String(url).endsWith('/keyframes') ? [variant] : []
|
||||
data: String(url).endsWith('/generation-models')
|
||||
? imageCatalog
|
||||
: String(url).endsWith('/creative-profile')
|
||||
? generationProfile('public-variant-contract')
|
||||
: String(url).endsWith('/keyframes')
|
||||
? [variant]
|
||||
: []
|
||||
})
|
||||
)
|
||||
)
|
||||
@@ -110,7 +128,10 @@ describe('精简公开资产回归', () => {
|
||||
})
|
||||
try {
|
||||
await flushPromises()
|
||||
await wrapper.findAll('button').find(item => item.text().includes('管理候选'))!.trigger('click')
|
||||
await wrapper
|
||||
.findAll('button')
|
||||
.find(item => item.text().includes('管理候选'))!
|
||||
.trigger('click')
|
||||
await flushPromises()
|
||||
expect(document.body.textContent).toContain('模型输入变体')
|
||||
expect(wrapper.findAll('button').some(button => button.text() === '设为主首帧')).toBe(false)
|
||||
@@ -129,7 +150,13 @@ describe('精简公开资产回归', () => {
|
||||
async url =>
|
||||
new Response(
|
||||
JSON.stringify({
|
||||
data: String(url).endsWith('/keyframes') ? [primary, candidate] : []
|
||||
data: String(url).endsWith('/generation-models')
|
||||
? imageCatalog
|
||||
: String(url).endsWith('/creative-profile')
|
||||
? generationProfile(projectId)
|
||||
: String(url).endsWith('/keyframes')
|
||||
? [primary, candidate]
|
||||
: []
|
||||
})
|
||||
)
|
||||
)
|
||||
@@ -144,12 +171,15 @@ describe('精简公开资产回归', () => {
|
||||
expect(wrapper.find('.primary-keyframe-mark').attributes('aria-label')).toBe('当前主首帧')
|
||||
expect(wrapper.findAll('button').some(item => item.text().includes('设为主首帧'))).toBe(false)
|
||||
|
||||
await wrapper.findAll('button').find(item => item.text().includes('管理候选'))!.trigger('click')
|
||||
await wrapper
|
||||
.findAll('button')
|
||||
.find(item => item.text().includes('管理候选'))!
|
||||
.trigger('click')
|
||||
await flushPromises()
|
||||
expect(document.body.textContent).toContain('首帧候选管理')
|
||||
expect([...document.querySelectorAll('button')].some(item => item.textContent?.includes('设为主首帧'))).toBe(
|
||||
false
|
||||
)
|
||||
expect(
|
||||
[...document.querySelectorAll('button')].some(item => item.textContent?.includes('设为主首帧'))
|
||||
).toBe(false)
|
||||
|
||||
const session = qualitySession(
|
||||
qualityKey(projectId, { kind: 'keyframe', shotId: shot.shotId, assetId: candidate.id, title: '' })
|
||||
@@ -172,16 +202,16 @@ describe('精简公开资产回归', () => {
|
||||
}
|
||||
await flushPromises()
|
||||
expect(sessionKeyframePassed(projectId, shot.shotId, candidate.id)).toBe(false)
|
||||
expect([...document.querySelectorAll('button')].some(item => item.textContent?.includes('设为主首帧'))).toBe(
|
||||
false
|
||||
)
|
||||
expect(
|
||||
[...document.querySelectorAll('button')].some(item => item.textContent?.includes('设为主首帧'))
|
||||
).toBe(false)
|
||||
|
||||
session.receipt.result.passed = true
|
||||
await flushPromises()
|
||||
expect(sessionKeyframePassed(projectId, shot.shotId, candidate.id)).toBe(true)
|
||||
expect([...document.querySelectorAll('button')].some(item => item.textContent?.includes('设为主首帧'))).toBe(
|
||||
true
|
||||
)
|
||||
expect(
|
||||
[...document.querySelectorAll('button')].some(item => item.textContent?.includes('设为主首帧'))
|
||||
).toBe(true)
|
||||
} finally {
|
||||
wrapper.unmount()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user