1
This commit is contained in:
@@ -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,
|
||||
}),
|
||||
],
|
||||
}),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user