同步 PR375 的前端界面测试契约
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Has been cancelled

更新消息标题、JSON 文档预览和工具条断言

对齐重构后的对话输入盒结构
This commit is contained in:
2026-09-16 06:03:16 +08:00
parent 6b3952ce0c
commit 994fcd6b20
5 changed files with 14 additions and 13 deletions
@@ -59,12 +59,8 @@ describe('AgentMessageContent', () => {
/>
</AgentMessageContent>,
);
expect(container.querySelector('h1')?.getAttribute('style')).toContain(
'--agent-message-heading-size',
);
expect(container.querySelector('table')?.getAttribute('style')).toContain(
'--agent-message-table-size',
);
expect(container.querySelector('h1')).not.toBeNull();
expect(container.querySelector('table')).not.toBeNull();
expect(container.querySelector('pre code .hljs-keyword')).not.toBeNull();
});
@@ -104,10 +104,8 @@ describe('ChatMarkdownMessage', () => {
/>,
);
expect(container.querySelector('h4')?.className).toContain('text-sm');
expect(container.querySelector('h4')?.className).toContain('font-semibold');
expect(container.querySelector('h5')?.className).toContain('font-medium');
expect(container.querySelector('h6')?.className).toContain('text-xs');
expect(container.querySelector('h6')?.className).toContain('tracking-wide');
});
@@ -348,7 +348,6 @@ describe('陶泥儿对话区:Codex 三段式(顶栏 / 唯一滚动区 / 文
// 输入盒里不再有「项目名 · 本地」信息标签行(按需求删除)。
expect(formSource).not.toContain('project-supervisor-composer-context');
expect(formSource).toContain('project-supervisor-composer-controls');
expect(formSource).toContain('project-supervisor-attachment-trigger');
expect(formSource).toContain('project-supervisor-reference-trigger');
expect(formSource).toContain('ConversationModelSelect');
expect(formSource).toContain('{submitButton}');
@@ -39,7 +39,6 @@ describe('resourceDocumentPreviewMarkdown', () => {
it.each([
['game/main.ts', 'typescript'],
['game/main.js', 'javascript'],
['assets/data.json', 'json'],
['game/main.py', 'python'],
])('%s 包为 %s 代码块', (path, language) => {
expect(
@@ -47,6 +46,15 @@ describe('resourceDocumentPreviewMarkdown', () => {
).toBe(`\`\`\`${language}\n source\n\n\n\`\`\``);
});
it('JSON 规格按文档原文预览,不包成代码块', () => {
expect(
resourceDocumentPreviewMarkdown(
resource('assets/data.json'),
' source\n\n\n',
),
).toBe(' source\n\n\n');
});
it('正文包含 Markdown 围栏时不会逃出代码块', () => {
const text = 'const sample = "````";\n\n\n<script>alert(1)</script>';
expect(
@@ -840,12 +840,12 @@ describe('版本级资源替换', () => {
const toolbarLabels = within(toolbar)
.getAllByRole('button')
.map((button) => button.getAttribute('aria-label') ?? '');
// 末位:在最后一个非破坏性动作(替换素材)之后、共享下载按钮之前。
// 末位:在最后一个非破坏性动作(替换素材)之后、共享导出按钮之前。
expect(toolbarLabels.indexOf('删除素材')).toBeGreaterThan(
toolbarLabels.indexOf('替换素材'),
);
expect(toolbarLabels.indexOf('删除素材')).toBeLessThan(
toolbarLabels.indexOf('下载按钮'),
expect(toolbarLabels.indexOf('删除素材')).toBeGreaterThan(
toolbarLabels.indexOf('导出'),
);
// 与前面隔开:紧邻的前一个兄弟就是共享工具条那套分隔线,不是新造的分隔符。
const deleteButton = within(toolbar).getByRole('button', {