deerflow2/frontend/tests
Huixin615 a17d2ff8f8
fix(mcp): surface admin-required state on settings tools page (#3527) (#3533)
GET /api/mcp/config returns 403 for non-admin users, but the previous
client returned the error body as MCPConfig, causing MCPServerList to
crash with 'Cannot convert undefined or null to object' on
Object.entries(config.mcp_servers).

- api.ts: introduce MCPConfigRequestError; loadMCPConfig and
  updateMCPConfig now throw it (carrying status + isAdminRequired)
  instead of letting non-2xx bodies leak through as parsed config
- tool-settings-page.tsx: render a friendly 'admin privileges required'
  empty state when the React Query error is an admin-required
  MCPConfigRequestError; keep MCPServerList resilient with
  Object.entries(servers ?? {}) and an empty-state for no servers
- i18n: add settings.tools.adminRequired and settings.tools.empty in
  en-US, zh-CN and the Translations type
- tests: cover 403 / 5xx / instanceof / detail-fallback for both
  loadMCPConfig and updateMCPConfig in tests/unit/core/mcp/api.test.ts

Refs: #3527
2026-06-13 07:36:57 +08:00
..
e2e fix(frontend): render user messages as plain text and cap blockquote nesting (#3502) 2026-06-12 16:15:40 +08:00
e2e-real-backend fix: align auth-disabled mode and mock history loading (#3471) 2026-06-10 16:11:00 +08:00
e2e-record fix(replay-e2e): match by conversation, not the living system prompt (#3436) 2026-06-08 17:32:41 +08:00
unit fix(mcp): surface admin-required state on settings tools page (#3527) (#3533) 2026-06-13 07:36:57 +08:00