mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-06-13 01:49:41 +08:00
16 lines
739 B
TypeScript
16 lines
739 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { readFileSync } from 'node:fs';
|
|
|
|
const source = readFileSync(new URL('./AIChatPanel.tsx', import.meta.url), 'utf8');
|
|
|
|
describe('AIChatPanel message render isolation', () => {
|
|
it('keeps per-message render failures scoped to the broken bubble', () => {
|
|
expect(source).toContain('class AIMessageRenderBoundary extends React.Component');
|
|
expect(source).toContain('[AI Message Render Error]');
|
|
expect(source).toContain('这条 AI 消息渲染失败,已自动隔离');
|
|
expect(source).toContain('__gonaviLastAIMessageRenderError');
|
|
expect(source).toContain('<AIMessageRenderBoundary');
|
|
expect(source).toContain('onDeleteMessage={handleDeleteMessage}');
|
|
});
|
|
});
|