fix(short-drama-agent-front): 修复资产库请求与管理流程

This commit is contained in:
GJ committed 2026-11-01 22:17:59 +08:00
1 parent 41d1cfe3ed
commit f8b0fbb8ca
10 files changed
+672 -77

No files matched your search

+15 -1
View File
@@ -90,7 +90,7 @@ async function openProject(initialPath: string) {
{
path: '/projects/:projectId',
component: ProjectLayout,
children: ['create-drama', ...downstream].map(path => ({
children: ['create-drama', ...downstream, 'assets', 'unknown-step'].map(path => ({
path,
component: {
setup() {
@@ -114,6 +114,20 @@ async function openProject(initialPath: string) {
}
describe('剧本完成前的下游访问限制', () => {
it('已知项目资产入口不受制作阶段拦截,未知工作区仍默认锁定', async () => {
const id = 'independent-project-assets'
vi.mocked(projectsApi.stageReadiness).mockResolvedValue(readiness(id, false))
vi.spyOn(projectsApi, 'detail').mockResolvedValue(project(id, 'generating'))
vi.spyOn(projectsApi, 'checkpoints').mockResolvedValue([])
const { router, mounted } = await openProject(`/projects/${id}/assets`)
expect(mounted).toHaveBeenCalledExactlyOnceWith('assets')
expect(wrapper!.find('.project-access-gate').exists()).toBe(false)
await router.push(`/projects/${id}/unknown-step`)
await flushPromises()
expect(mounted).not.toHaveBeenCalledWith('unknown-step')
expect(wrapper!.find('.project-access-gate').exists()).toBe(true)
})
it('导航使用当前阶段结果,旧待审标记不盖过已审核状态,下游素材仍独立限制', async () => {
const id = 'current-review-navigation'
const state = readiness(id, false)