This commit is contained in:
2026-05-08 11:44:42 +08:00
parent b08127031c
commit abf1f1ebea
249 changed files with 39411 additions and 887 deletions

View File

@@ -589,4 +589,40 @@ describe('PuzzleResultView', () => {
}),
);
});
test('shows creative agent draft edit bar and submits the current draft', () => {
const onSubmit = vi.fn();
render(
<PuzzleResultView
session={createSession()}
onBack={() => {}}
onExecuteAction={() => {}}
creativeDraftEdit={{
isBusy: false,
error: null,
onSubmit,
}}
/>,
);
fireEvent.change(screen.getByLabelText('智能修订拼图草稿'), {
target: { value: '把标题改得轻松一点' },
});
fireEvent.click(screen.getByRole('button', { name: '修改' }));
expect(onSubmit).toHaveBeenCalledWith({
instruction: '把标题改得轻松一点',
currentDraft: expect.objectContaining({
workTitle: '暖灯猫街作品',
workDescription: '一套雨夜猫街主题拼图。',
levels: [
expect.objectContaining({
levelId: 'puzzle-level-1',
pictureReference: null,
}),
],
}),
});
});
});