From 47ba54f47db4f22f69375310925eedab020b3cf0 Mon Sep 17 00:00:00 2001 From: mesalogo Date: Mon, 28 Sep 2026 15:23:31 +0800 Subject: [PATCH] test: derive MCP settings expectations from the catalog Include Story Graph in the shared settings fixture and verify every catalog server by identity, rather than filtering buttons against an outdated list of five names. Preserve the existing count and interaction assertions. Complete SettingsPanel tests, typecheck, lint and bilingual notes checks passed; the full suite remains delegated to CI as requested. --- .../development/release-preparation-0.15.2.md | 9 ++++ src/renderer/src/SettingsPanel.test.tsx | 50 ++++--------------- 2 files changed, 20 insertions(+), 39 deletions(-) diff --git a/docs/development/release-preparation-0.15.2.md b/docs/development/release-preparation-0.15.2.md index 7637d7e7..28fa1a6f 100644 --- a/docs/development/release-preparation-0.15.2.md +++ b/docs/development/release-preparation-0.15.2.md @@ -37,3 +37,12 @@ Story Graph 已有开发期证据见 本地全量不记为通过,由精确候选的主分支 CI 执行完整测试和生产构建,通过后才打标签。 不运行本地生产构建、安装包打包或安装包启动;使用既有隔离 Host 目录,不更改生产 Agent。 schema 保持 48;从旧版升级应备份完整数据库和相邻 `notes/`,不能用旧客户端打开升级后的库。 + +## 首次候选 CI + +`76e781a` 已同步双远端。Agent [CI 36379713606](https://github.com/mesalogo/goodbuddy/actions/runs/36379713606) +通过;Desktop [CI 36379713607](https://github.com/mesalogo/goodbuddy/actions/runs/36379713607) +5,389 通过、51 跳过、1 失败,生产构建未执行,未打标签。 +失败的设置测试用固定五个服务器名称过滤按钮,却用新增 Story Graph 后的六项目录断言数量。 +同步把旧模拟列表与按钮身份断言改为复用正式目录,保留数量和原交互断言,并逐项验证目录按钮存在。 +最终完整 SettingsPanel 文件、类型、lint 和发布说明检查通过;全量继续交由新提交 CI。 diff --git a/src/renderer/src/SettingsPanel.test.tsx b/src/renderer/src/SettingsPanel.test.tsx index 36d4584a..7bf0d086 100644 --- a/src/renderer/src/SettingsPanel.test.tsx +++ b/src/renderer/src/SettingsPanel.test.tsx @@ -257,44 +257,11 @@ const capabilitySnapshot = { )[] } ], - builtinMcpServers: [ - { - id: 'knowledge-base' as const, - enabled: true, - assignments: ['model', 'opencode', 'continue'] as ( - | 'model' - | 'opencode' - | 'continue' - )[] - }, - { - id: 'magic-notes' as const, - enabled: true, - assignments: ['model', 'opencode', 'continue'] as ( - | 'model' - | 'opencode' - | 'continue' - )[] - }, - { - id: 'goodbuddy-config' as const, - enabled: true, - assignments: ['model', 'opencode', 'continue'] as ( - | 'model' - | 'opencode' - | 'continue' - )[] - }, - { - id: 'builtin-browser' as const, - enabled: false, - assignments: ['model', 'opencode', 'continue'] as ( - | 'model' - | 'opencode' - | 'continue' - )[] - } - ], + builtinMcpServers: builtinMcpServers.map(server => ({ + id: server.id, + enabled: server.id !== 'builtin-browser' && server.id !== 'obsidian', + assignments: [...server.supportedAssignments] + })), mcpServers: [] as CapabilitySnapshot['mcpServers'], obsidian: { vaultPath: '' }, webSearch: { @@ -5857,9 +5824,14 @@ describe('SettingsPanel runtime files', () => { ).toBeInTheDocument() expect( screen.getAllByRole('button', { - name: /(?:展开|收起)服务器 (?:知识库|笔记|Obsidian|GoodBuddy 配置|内置浏览器)/u + name: /^(?:展开|收起)服务器 /u }) ).toHaveLength(builtinMcpServers.length) + for (const server of builtinMcpServers) { + expect(screen.getByRole('button', { + name: name => name === `展开服务器 ${server.name}` || name === `收起服务器 ${server.name}` + })).toBeInTheDocument() + } expect( screen.queryByText(/按请求提供,可分别控制启停与 Runtime 分配/) ).not.toBeInTheDocument()