fix: avoid stray zero in consultation composer
This commit is contained in:
@@ -96,6 +96,15 @@ async function ready() {
|
||||
await waitFor(() => expect(streams.has('first')).toBe(true));
|
||||
}
|
||||
describe('teacher side chat', () => {
|
||||
it('does not render a zero for an empty legacy friend draft', async () => {
|
||||
localStorage.setItem('makelore-consultation-draft:signed-out:p:friend', JSON.stringify({ text: '', references: [] }));
|
||||
render(<TeacherChatPanel projectId="p" sourceId="c" />);
|
||||
await ready();
|
||||
const composer = screen.getByLabelText('向智能体提问').closest('form');
|
||||
expect(composer).not.toHaveTextContent(/^0/);
|
||||
expect(screen.queryByText('查看旧版朋友草稿')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('retains failed input and retries with the same request id, then appends a reply only on click', async () => {
|
||||
const bringBack = vi.fn();
|
||||
api.send
|
||||
|
||||
Reference in New Issue
Block a user