Merge teacher composer actions into latest main
This commit is contained in:
@@ -1074,18 +1074,23 @@ describe('merged cloud teacher classroom', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('selects a teacher model for the next send and retains it after remount', async () => {
|
||||
it('hides teacher model details while preserving an existing choice across sends and remount', async () => {
|
||||
localStorage.setItem('makelore-teacher-model:signed-out:coding-teacher:published', 'other-model');
|
||||
const view = render(<TeacherChatPanel projectId="p" sourceId="c" />);
|
||||
await ready();
|
||||
const trigger = screen.getByRole('button', { name: /老师模型/ });
|
||||
fireEvent.keyDown(trigger, { key: 'Enter' });
|
||||
fireEvent.click(await screen.findByRole('menuitemradio', { name: 'other-model' }));
|
||||
expect(screen.queryByRole('button', { name: /老师模型/ })).not.toBeInTheDocument();
|
||||
expect(screen.getByTestId('teacher-composer-runtime-controls')).not.toHaveTextContent(/other-model|qwen|老师配置|模型默认/);
|
||||
fireEvent.change(screen.getByRole('textbox', { name: '向智能体提问' }), { target: { value: '我的想法' } });
|
||||
api.send.mockResolvedValue(first);
|
||||
fireEvent.click(screen.getByRole('button', { name: '提问' }));
|
||||
await waitFor(() => expect(api.send).toHaveBeenCalledWith('p/agent-topics', 'first', expect.objectContaining({ modelId: 'other-model', text: '我的想法' })));
|
||||
view.unmount();
|
||||
render(<TeacherChatPanel projectId="p" sourceId="c" />);
|
||||
await screen.findByRole('button', { name: /老师模型:other-model/ });
|
||||
await ready();
|
||||
expect(screen.queryByRole('button', { name: /老师模型/ })).not.toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '语音输入' })).toBeInTheDocument();
|
||||
fireEvent.change(screen.getByRole('textbox', { name: '向智能体提问' }), { target: { value: '继续聊聊' } });
|
||||
fireEvent.click(screen.getByRole('button', { name: '提问' }));
|
||||
await waitFor(() => expect(api.send).toHaveBeenLastCalledWith('p/agent-topics', 'first', expect.objectContaining({ modelId: 'other-model', text: '继续聊聊' })));
|
||||
expect(api.models).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user