Restore Agent workspace and add platform pixel avatars
This commit is contained in:
1 parent
7a7d1f7fd8
commit
c14d996c05
22 files changed
+1387
-462
No files matched your search
@@ -65,19 +65,25 @@ it('starts private use through the existing publication action and retains its i
|
||||
expect(api.call.mock.calls.some(([operation]) => operation === 'share' || operation === 'createApplication')).toBe(false);
|
||||
});
|
||||
|
||||
it('keeps custom requirements intact while toggling and editing answer styles', () => {
|
||||
it('preserves the entire prompt when displaying and editing former style instruction lines', () => {
|
||||
const initial = '我的规则\n\n 保留缩进和解释。\n使用简单易懂的语言,遇到新词先解释。\n把任务拆成小步骤,一次引导我完成一步。\n先给我提示和思考问题,让我尝试后再补充答案。\n';
|
||||
const edited = '先给我提示和思考问题,让我尝试后再补充答案。\n\n 我的新规则\n使用简单易懂的语言,遇到新词先解释。\n把任务拆成小步骤,一次引导我完成一步。\n\n';
|
||||
const onChange = vi.fn();
|
||||
function Requirements() {
|
||||
const [value, setValue] = useState('我的规则\n\n 保留缩进和解释。');
|
||||
const [value, setValue] = useState(initial);
|
||||
return <AgentRequirements value={value} onChange={next => { onChange(next); setValue(next); }} />;
|
||||
}
|
||||
render(<Requirements />);
|
||||
fireEvent.click(screen.getByRole('button', { name: '简单易懂' }));
|
||||
fireEvent.click(screen.getByRole('button', { name: '先给我提示' }));
|
||||
expect(screen.getByLabelText('特别要求')).toHaveValue('我的规则\n\n 保留缩进和解释。');
|
||||
fireEvent.click(screen.getByRole('button', { name: '简单易懂' }));
|
||||
fireEvent.change(screen.getByLabelText('特别要求'), { target: { value: '我的新规则' } });
|
||||
expect(onChange).toHaveBeenLastCalledWith('我的新规则\n先给我提示和思考问题,让我尝试后再补充答案。');
|
||||
const prompt = screen.getByLabelText('提示词');
|
||||
expect(prompt).toHaveValue(initial);
|
||||
expect(prompt).toHaveAttribute('maxlength', '32000');
|
||||
expect(prompt).toHaveAttribute('placeholder', '填写智能体的任务和要求');
|
||||
expect(screen.queryByRole('button')).not.toBeInTheDocument();
|
||||
expect(onChange).not.toHaveBeenCalled();
|
||||
fireEvent.change(prompt, { target: { value: edited } });
|
||||
expect(onChange).toHaveBeenCalledOnce();
|
||||
expect(onChange).toHaveBeenLastCalledWith(edited);
|
||||
expect(prompt).toHaveValue(edited);
|
||||
});
|
||||
|
||||
it('waits for a successful save, preserves the old trial and reuses its question without sending', async () => {
|
||||
|
||||
Reference in new issue
Block a user