test: 补充创建项目标题参数
This commit is contained in:
1 parent
b352560ee8
commit
6de4faae2a
1 file changed
+2
-1
@@ -135,11 +135,12 @@ describe('后端 API 契约', () => {
|
|||||||
)
|
)
|
||||||
vi.stubGlobal('fetch', fetcher)
|
vi.stubGlobal('fetch', fetcher)
|
||||||
expect(await projectsApi.list()).toEqual([{ id: 'p1' }])
|
expect(await projectsApi.list()).toEqual([{ id: 'p1' }])
|
||||||
expect(await projectsApi.create({ topic: '故事', style: '悬疑', episodeCount: 3 })).toEqual({
|
expect(await projectsApi.create({ title: '测试项目', topic: '故事', style: '悬疑', episodeCount: 3 })).toEqual({
|
||||||
projectId: 'p2',
|
projectId: 'p2',
|
||||||
status: 'generating'
|
status: 'generating'
|
||||||
})
|
})
|
||||||
expect(JSON.parse(fetcher.mock.calls[1]![1].body as string)).toEqual({
|
expect(JSON.parse(fetcher.mock.calls[1]![1].body as string)).toEqual({
|
||||||
|
title: '测试项目',
|
||||||
topic: '故事',
|
topic: '故事',
|
||||||
style: '悬疑',
|
style: '悬疑',
|
||||||
episodeCount: 3
|
episodeCount: 3
|
||||||
|
|||||||
Reference in new issue
Block a user