refactor: analysis workflow architecture

fix: NEXTAUTH_URL

fix: prevent project model edits from affecting default model
This commit is contained in:
saturn
2026-03-16 21:48:57 +08:00
parent ecbd183a77
commit 9aff44e37a
58 changed files with 2753 additions and 7985 deletions

View File

@@ -60,7 +60,7 @@ describe('api specific - novel promotion project art style validation', () => {
vi.clearAllMocks()
})
it('accepts valid artStyle and syncs to user preference', async () => {
it('accepts valid artStyle and keeps user preference unchanged', async () => {
const mod = await import('@/app/api/novel-promotion/[projectId]/route')
const req = buildMockRequest({
path: '/api/novel-promotion/project-1',
@@ -77,11 +77,7 @@ describe('api specific - novel promotion project art style validation', () => {
data: expect.objectContaining({ artStyle: 'realistic' }),
}),
)
expect(prismaMock.userPreference.upsert).toHaveBeenCalledWith(
expect.objectContaining({
update: expect.objectContaining({ artStyle: 'realistic' }),
}),
)
expect(prismaMock.userPreference.upsert).not.toHaveBeenCalled()
})
it('rejects invalid artStyle with invalid params', async () => {
@@ -102,7 +98,7 @@ describe('api specific - novel promotion project art style validation', () => {
expect(prismaMock.userPreference.upsert).not.toHaveBeenCalled()
})
it('accepts audioModel and syncs it to user preference', async () => {
it('accepts audioModel and keeps user preference unchanged', async () => {
const mod = await import('@/app/api/novel-promotion/[projectId]/route')
const req = buildMockRequest({
path: '/api/novel-promotion/project-1',
@@ -121,12 +117,6 @@ describe('api specific - novel promotion project art style validation', () => {
}),
}),
)
expect(prismaMock.userPreference.upsert).toHaveBeenCalledWith(
expect.objectContaining({
update: expect.objectContaining({
audioModel: 'bailian::qwen3-tts-vd-2026-01-26',
}),
}),
)
expect(prismaMock.userPreference.upsert).not.toHaveBeenCalled()
})
})