Skip to content

test(admin/mcp): admin と server/mcp をカバレッジ目標 80% に到達させる (#1037)#1046

Merged
otomatty merged 3 commits into
developfrom
cursor/admin-mcp-coverage-80-6b1d
Jun 11, 2026
Merged

test(admin/mcp): admin と server/mcp をカバレッジ目標 80% に到達させる (#1037)#1046
otomatty merged 3 commits into
developfrom
cursor/admin-mcp-coverage-80-6b1d

Conversation

@otomatty

@otomatty otomatty commented Jun 11, 2026

Copy link
Copy Markdown
Owner

概要

Issue #1037 の受け入れ条件に沿い、adminserver/mcp のラインカバレッジを 80% 以上に引き上げるため、仕様駆動(/spec-test)の観点で単体テストを拡充しました。破壊的操作(BAN / 削除 / サスペンド)の確認→実行→失敗時通知、MCP ツールの入出力契約、HTTP 認可エラーを重点的に検証しています。

変更点

admin/

  • ユーザー管理 (index.test.tsx, UsersContent.test.tsx): デバウンス検索、ロール変更 / サスペンド / 復活 / 削除の成功・失敗、確認ダイアログ分岐、バッジ・ページネーション境界
  • API エラー (useApiErrors.test.ts, ErrorsContent.test.tsx, ErrorDetailDialog.test.tsx): SSE マージ / フィルタ除外 / ポーリング / レース、フィルタ UI、詳細ダイアログの保存・AI 解析表示
  • AI モデル (useAiModelActions.test.ts): handleSetSystemDefault の楽観的更新・失敗ロールバック・早期 return
  • API クライアント (admin.test.ts): getUsers, patchUserRole, suspendUser, unsuspendUser, getUserImpact, deleteUser, getAuditLogs

server/mcp/

  • ツールハンドラ (tools/index.test.ts): 全ツールの handler 単体テスト(クライアント呼び出し・JSON 応答・API 失敗時 isError、スキーマバリデーション)
  • HTTP トランスポート (http.test.ts): Bearer 認可成功 / 失敗、トランスポートエラー、server.close の finally
  • ヘルパ (helpers.test.ts): jsonResult / textResult
  • @vitest/coverage-v8 を devDependency に追加(カバレッジ計測用)

カバレッジ結果

ワークスペース 変更前 (Lines) 変更後 (Lines)
admin 68.6% 93.6%
server/mcp 67.6% 89.8%

計測コマンド:

cd admin && bunx vitest run --config vitest.config.ts --coverage
cd server/mcp && bunx vitest run --config vitest.config.ts --coverage

変更の種類

  • 🧪 テスト (Tests)

テスト方法

  1. cd admin && bunx vitest run --config vitest.config.ts → 210 tests pass
  2. cd server/mcp && bunx vitest run --config vitest.config.ts → 90 tests pass
  3. カバレッジ確認: 上記 --coverage 付きで Lines ≥ 80% を確認

チェックリスト

  • テストがすべてパスする
  • 変更ファイルに対する ESLint エラーなし(既存 warning は対象外)
  • Prettier 適用済み
  • ドキュメント更新不要(テストのみ)

アサーション強度レビュー(Stryker 対象外ワークスペース)

admin — 総合評価: Adequate

モジュール 評価 備考
useAiModelActions Strong 楽観的更新・rollback・unmount ガードを具体値で検証
useApiErrors Strong SSE マージ / drop / レース / ポーリングを網羅
index.tsx (Users) Adequate 破壊的操作の成功・失敗を E2E 近似で検証
UsersContent Adequate ダイアログ分岐・バッジ・削除確認をカバー
ErrorsContent / ErrorDetailDialog Adequate フィルタ・保存・AI セクション表示
admin.ts (user/audit) Adequate REST 成功 / 失敗パス

軽微な follow-up(必須ではない): onSearchChangetoHaveBeenCalledWith で厳密化、systemDefault + toggle 相互作用テスト。

server/mcp — 総合評価: Adequate(推定 mutation 70–75%)

優先度 ギャップ
一部ツールハンドラの expectedPayload 未設定(戻り値 BlockStatement ミュータントが生存しうる)
スキーマバリデーション代表ケース(空文字 / enum 無効値)を追加するとより強固
HTTP 401 レスポンスボディ未検証、wrapToolHandler の非 Error throw パス

本 PR ではカバレッジ目標達成を優先。上記は follow-up issue 候補。

関連 Issue

Closes #1037

Open in Web Open in Cursor 

Summary by CodeRabbit

  • Tests
    • Expanded test coverage across admin UI flows: user management (search, suspend/unsuspend, role changes, delete/impact), error dialogs and badges, AI model defaulting, and API error streaming/polling behaviors.
    • Broadened MCP HTTP and tool integration tests to verify authorization, proxying, and tool result handling.
    • Added test tooling for coverage reporting.

…#1037)

Expand unit tests for admin user management, API errors, AI model actions,
and admin API client helpers. Add MCP tool handler contract tests and HTTP
transport auth/error coverage.
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 41d68fbc-4259-4086-bd43-d034cd3f26da

📥 Commits

Reviewing files that changed from the base of the PR and between 1377930 and bd51215.

📒 Files selected for processing (5)
  • admin/src/pages/ai-models/useAiModelActions.test.ts
  • admin/src/pages/errors/ErrorsContent.test.tsx
  • admin/src/pages/errors/useApiErrors.test.ts
  • server/mcp/src/__tests__/http.test.ts
  • server/mcp/src/__tests__/tools/index.test.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • server/mcp/src/tests/http.test.ts
  • admin/src/pages/ai-models/useAiModelActions.test.ts
  • server/mcp/src/tests/tools/index.test.ts
  • admin/src/pages/errors/ErrorsContent.test.tsx
  • admin/src/pages/errors/useApiErrors.test.ts

📝 Walkthrough

Walkthrough

Adds many unit tests across admin and server/mcp: admin API client, UI dialogs/hooks/actions, AI-model action tests, users page workflows; and mcp coverage tooling, HTTP authorization/proxy tests, tool helpers, and tool registration/handler tests.

Changes

Admin package test coverage

Layer / File(s) Summary
Admin API client coverage
admin/src/api/admin.test.ts
New tests for getUsers, patchUserRole, suspendUser, unsuspendUser, getUserImpact, deleteUser, and getAuditLogs verify HTTP methods, request bodies, query-string construction, and error propagation.
AI model system default action
admin/src/pages/ai-models/useAiModelActions.test.ts
Tests for handleSetSystemDefault verify successful PATCH updates with state synchronization, failure rollback with error reporting, no-op conditions, and concurrency control.
Error detail dialog behavior
admin/src/pages/errors/ErrorDetailDialog.test.tsx
Tests verify status update callbacks, disabled save-button conditions, saveError alert rendering, AI analysis section rendering, and GitHub issue link display.
ErrorsContent & useApiErrors behavior
admin/src/pages/errors/ErrorsContent.test.tsx, admin/src/pages/errors/useApiErrors.test.ts
Mocks capture Select change handlers, asserts filter-change callbacks, total count and badge rendering, and adds hook tests for REST failures, refetch, invalid SSE payloads, filter-driven row removal, polling fallback, and stale-response handling.
UsersContent dialog & action state
admin/src/pages/users/UsersContent.test.tsx
Adds ConfirmActionDialog cancel support, dialog-target tracking, beforeEach reset, and tests for status badges, suspend/delete buttons, delete flow, saving-state UI, and canceling role-change dialog.
Users page admin workflows
admin/src/pages/users/index.test.tsx
Expanded @zedi/ui mocks, select callback plumbing, UserCard mock, shared fixture/helper; tests for debounced search, status-filter reloads, role-change success/error, suspend/unsuspend flows, and delete+impact lookup.

Server/MCP package test coverage

Layer / File(s) Summary
Coverage tooling setup
server/mcp/package.json
Added @vitest/coverage-v8 devDependency to enable Vitest coverage reporting.
HTTP authorization and MCP proxying
server/mcp/src/__tests__/http.test.ts
Mocks createMcpServer/transport/HttpZediClient, adds mcpPost helper, and tests 401 cases, valid Bearer proxying and wiring, server.connect/close behavior, and transport-failure -> 500 response.
Tool result helpers
server/mcp/src/__tests__/tools/helpers.test.ts
Tests verify jsonResult produces pretty-printed JSON and textResult constructs a single text content item.
Tool registration and handler behavior
server/mcp/src/__tests__/tools/index.test.ts
Adds createServerStub and expectJsonContent helpers, defines per-tool handler cases, and verifies registration completeness, ZediClient invocation, JSON content matches, API failures produce isError, and MCP-schema rejects invalid args.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

  • otomatty/zedi#908: Overlaps in admin error-related test coverage for ErrorDetailDialog, ErrorsContent, and useApiErrors.
  • otomatty/zedi#760: Related tests for useAiModelActions optimistic updates and rollback behavior.
  • otomatty/zedi#983: Related system-default model behavior tests (optimistic update, rollback, concurrency).

Poem

"I am a rabbit with a tiny test pen,
Hopping through mocks and fixtures again,
Users, errors, models, and tools I commend,
Coverage grows — carrots for every friend 🥕"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly indicates the primary change: adding test coverage to reach 80% line coverage target for admin and server/mcp workspaces, referencing issue #1037.
Linked Issues check ✅ Passed The pull request successfully addresses all major coding requirements from issue #1037: comprehensive test coverage for user management (search, role changes, suspend/unsuspend/delete flows), API error handling, AI model actions, MCP tool handlers, and HTTP authorization, achieving target line coverage of 80%+ for both workspaces.
Out of Scope Changes check ✅ Passed All changes are directly related to achieving the 80% line coverage target specified in issue #1037; adding test cases across admin and server/mcp modules with one supporting devDependency addition for coverage tooling.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/admin-mcp-coverage-80-6b1d

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly expands test coverage across the admin frontend and the MCP server, adding unit and integration tests for API endpoints, dialogs, hooks, and tool handlers. The reviewer's feedback focuses on improving test robustness and maintainability. Specifically, they recommend refactoring the fragile Select mock in ErrorsContent.test.tsx to use unique keys based on a counter, wrapping fake timer tests in useApiErrors.test.ts with a try...finally block to ensure timers are always restored, and removing redundant helper tests in index.test.ts that are already covered elsewhere.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

import { ErrorsContent } from "./ErrorsContent";
import type { ApiErrorRow } from "@/api/admin";

const selectCallbacks: Map<string, (v: string) => void> = new Map();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

脆弱なテストモックの改善

selectCallbacks のキーに value を使用しているため、複数の Select が同じ値(例:__any__)を持つ場合にコールバックが上書きされる危険性があります。レンダリング順(1番目が status、2番目が severity)に基づいて一意のキーを割り当てるカウンタ変数を導入することを推奨します。

Suggested change
const selectCallbacks: Map<string, (v: string) => void> = new Map();
let selectCount = 0;
const selectCallbacks: Map<string, (v: string) => void> = new Map();

Comment on lines +27 to +40
Select: ({
children,
value,
onValueChange,
}: {
children: React.ReactNode;
value?: string;
onValueChange?: (v: string) => void;
}) => {
if (onValueChange && value) {
selectCallbacks.set(value, onValueChange);
}
return <div data-value={value}>{children}</div>;
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

脆弱なテストモックの改善

レンダリング順(1番目が status、2番目が severity)に基づいて一意のキーを割り当てることで、コールバックの衝突を防ぎます。

  Select: ({
    children,
    value,
    onValueChange,
  }: {
    children: React.ReactNode;
    value?: string;
    onValueChange?: (v: string) => void;
  }) => {
    if (onValueChange) {
      const key = selectCount === 0 ? "status" : "severity";
      selectCallbacks.set(key, onValueChange);
      selectCount++;
    }
    return <div data-value={value}>{children}</div>;
  },

Comment on lines +95 to +97
beforeEach(() => {
selectCallbacks.clear();
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

テストごとのカウンタのリセット

各テストの実行前に selectCount をリセットして、テスト間の干渉を防ぎます。

Suggested change
beforeEach(() => {
selectCallbacks.clear();
});
beforeEach(() => {
selectCallbacks.clear();
selectCount = 0;
});

Comment on lines +147 to +152
const statusCallback = selectCallbacks.get("__any__");
expect(statusCallback).toBeDefined();
React.act(() => {
statusCallback?.("open");
});
expect(onStatusFilterChange).toHaveBeenCalledWith("open");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

テストでの一意なキーの使用

衝突を避けるため、新しく導入した一意のキー status を使用してコールバックを取得します。

Suggested change
const statusCallback = selectCallbacks.get("__any__");
expect(statusCallback).toBeDefined();
React.act(() => {
statusCallback?.("open");
});
expect(onStatusFilterChange).toHaveBeenCalledWith("open");
const statusCallback = selectCallbacks.get("status");
expect(statusCallback).toBeDefined();
React.act(() => {
statusCallback?.("open");
});
expect(onStatusFilterChange).toHaveBeenCalledWith("open");

Comment on lines +165 to +170
const severityCallback = selectCallbacks.get("__any__");
expect(severityCallback).toBeDefined();
React.act(() => {
severityCallback?.("high");
});
expect(onSeverityFilterChange).toHaveBeenCalledWith("high");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

テストでの一意なキーの使用

衝突を避けるため、新しく導入した一意のキー severity を使用してコールバックを取得します。

Suggested change
const severityCallback = selectCallbacks.get("__any__");
expect(severityCallback).toBeDefined();
React.act(() => {
severityCallback?.("high");
});
expect(onSeverityFilterChange).toHaveBeenCalledWith("high");
const severityCallback = selectCallbacks.get("severity");
expect(severityCallback).toBeDefined();
React.act(() => {
severityCallback?.("high");
});
expect(onSeverityFilterChange).toHaveBeenCalledWith("high");

Comment on lines +297 to +313
it("polls via fallback interval when stream is disabled", async () => {
vi.useFakeTimers();
const { unmount } = renderHook(() => useApiErrors({ intervalMs: 1000, enableStream: false }));
await act(async () => {
await Promise.resolve();
});
const callsBefore = vi.mocked(getApiErrors).mock.calls.length;

await act(async () => {
await vi.advanceTimersByTimeAsync(1000);
await Promise.resolve();
});

expect(vi.mocked(getApiErrors).mock.calls.length).toBeGreaterThan(callsBefore);
unmount();
vi.useRealTimers();
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

テスト失敗時のタイマー復元の保証

アサーションが失敗した場合に vi.useRealTimers() が実行されず、他のテストに偽のタイマー状態が引き継がれてしまうのを防ぐため、try...finally ブロックで保護することを推奨します。

  it("polls via fallback interval when stream is disabled", async () => {
    vi.useFakeTimers();
    try {
      const { unmount } = renderHook(() => useApiErrors({ intervalMs: 1000, enableStream: false }));
      await act(async () => {
        await Promise.resolve();
      });
      const callsBefore = vi.mocked(getApiErrors).mock.calls.length;

      await act(async () => {
        await vi.advanceTimersByTimeAsync(1000);
        await Promise.resolve();
      });

      expect(vi.mocked(getApiErrors).mock.calls.length).toBeGreaterThan(callsBefore);
      unmount();
    } finally {
      vi.useRealTimers();
    }
  });

Comment on lines +545 to +558
describe("jsonResult / textResult helpers", () => {
it("jsonResult serializes data as formatted JSON text content", () => {
const result = jsonResult({ ok: true, count: 2 });
expect(result.isError).toBeUndefined();
expect(result.content).toEqual([
{ type: "text", text: JSON.stringify({ ok: true, count: 2 }, null, 2) },
]);
});

it("textResult wraps plain text in a single content item", () => {
const result = textResult("hello");
expect(result).toEqual({ content: [{ type: "text", text: "hello" }] });
});
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

重複テストコードの削除

jsonResult および textResult ヘルパー関数のテストは、すでに helpers.test.ts で詳細に検証されています。冗長なテストコードを削除してメンテナンス性を向上させます。

@otomatty otomatty marked this pull request as ready for review June 11, 2026 09:33
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1377930f88

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +417 to +418
await first;
await second;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Initialize pending promises before awaiting them

In the admin CI path I checked, .github/workflows/ci.yml runs the admin production build, and admin/package.json defines that as tsc -b && vite build; because admin/tsconfig.json is strict and includes src, TypeScript cannot prove that first and second are assigned inside the act callback before these awaits, so this new test adds TS2454 errors and blocks the admin build/deploy. Initialize them with a definite value or use a non-null assertion after assignment.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
server/mcp/src/__tests__/http.test.ts (1)

83-91: ⚡ Quick win

Assert “no MCP wiring” for all unauthorized paths.

The missing/malformed auth tests only check 401. Add side-effect assertions (HttpZediClient/createMcpServer not called) there too, so auth short-circuit behavior is fully specified and mutation-resistant.

Proposed diff
   it("POST /mcp without Authorization returns 401", async () => {
     const res = await mcpPost();
     expect(res.status).toBe(401);
+    expect(mockHttpZediClient).not.toHaveBeenCalled();
+    expect(mockCreateMcpServer).not.toHaveBeenCalled();
   });

   it("POST /mcp with malformed Bearer returns 401", async () => {
     const res = await mcpPost({ Authorization: "Basic xyz" });
     expect(res.status).toBe(401);
+    expect(mockHttpZediClient).not.toHaveBeenCalled();
+    expect(mockCreateMcpServer).not.toHaveBeenCalled();
   });

As per coding guidelines, “Prioritize Mutation test score as the first quality indicator,” so these assertions improve spec strength in unauthorized branches.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@server/mcp/src/__tests__/http.test.ts` around lines 83 - 91, The two tests
for missing/malformed auth should also assert that the MCP wiring never runs:
after calling mcpPost() (and mcpPost({ Authorization: "Basic xyz" })), add
assertions that the mocked HttpZediClient constructor (or factory) and
createMcpServer were not invoked (e.g.,
expect(HttpZediClient).not.toHaveBeenCalled() and
expect(createMcpServer).not.toHaveBeenCalled()), so unauthorized requests
short-circuit without constructing the client or creating the server.

Source: Coding guidelines

server/mcp/src/__tests__/tools/index.test.ts (1)

545-558: ⚡ Quick win

Remove duplicate helper tests already covered in helpers.test.ts.

The tests for jsonResult and textResult at lines 545-558 duplicate the exact same unit tests already in helpers.test.ts lines 62-69. Both test files verify identical behavior (JSON formatting and text wrapping) with the same assertions. Since helpers.test.ts provides canonical unit test coverage for these helpers, this describe block is redundant.

🧹 Proposed fix to remove duplicate tests
-describe("jsonResult / textResult helpers", () => {
-  it("jsonResult serializes data as formatted JSON text content", () => {
-    const result = jsonResult({ ok: true, count: 2 });
-    expect(result.isError).toBeUndefined();
-    expect(result.content).toEqual([
-      { type: "text", text: JSON.stringify({ ok: true, count: 2 }, null, 2) },
-    ]);
-  });
-
-  it("textResult wraps plain text in a single content item", () => {
-    const result = textResult("hello");
-    expect(result).toEqual({ content: [{ type: "text", text: "hello" }] });
-  });
-});

Note: After removing these tests, the imports jsonResult and textResult at line 20 become unused and can also be removed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@server/mcp/src/__tests__/tools/index.test.ts` around lines 545 - 558, Remove
the redundant describe block testing jsonResult and textResult from
server/mcp/src/__tests__/tools/index.test.ts (the two it blocks starting with
"jsonResult serializes..." and "textResult wraps...") because identical tests
exist in helpers.test.ts; delete that entire describe/it block and then remove
the now-unused imports jsonResult and textResult (originally imported near the
top) to keep imports clean.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@server/mcp/src/__tests__/http.test.ts`:
- Around line 83-91: The two tests for missing/malformed auth should also assert
that the MCP wiring never runs: after calling mcpPost() (and mcpPost({
Authorization: "Basic xyz" })), add assertions that the mocked HttpZediClient
constructor (or factory) and createMcpServer were not invoked (e.g.,
expect(HttpZediClient).not.toHaveBeenCalled() and
expect(createMcpServer).not.toHaveBeenCalled()), so unauthorized requests
short-circuit without constructing the client or creating the server.

In `@server/mcp/src/__tests__/tools/index.test.ts`:
- Around line 545-558: Remove the redundant describe block testing jsonResult
and textResult from server/mcp/src/__tests__/tools/index.test.ts (the two it
blocks starting with "jsonResult serializes..." and "textResult wraps...")
because identical tests exist in helpers.test.ts; delete that entire describe/it
block and then remove the now-unused imports jsonResult and textResult
(originally imported near the top) to keep imports clean.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f15df7e5-c37d-4afe-8249-74ac1997120f

📥 Commits

Reviewing files that changed from the base of the PR and between fca3b66 and 1377930.

⛔ Files ignored due to path filters (1)
  • server/mcp/bun.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • admin/src/api/admin.test.ts
  • admin/src/pages/ai-models/useAiModelActions.test.ts
  • admin/src/pages/errors/ErrorDetailDialog.test.tsx
  • admin/src/pages/errors/ErrorsContent.test.tsx
  • admin/src/pages/errors/useApiErrors.test.ts
  • admin/src/pages/users/UsersContent.test.tsx
  • admin/src/pages/users/index.test.tsx
  • server/mcp/package.json
  • server/mcp/src/__tests__/http.test.ts
  • server/mcp/src/__tests__/tools/helpers.test.ts
  • server/mcp/src/__tests__/tools/index.test.ts

Fix MCP mock constructor types, complete NoteRow fixtures, admin test
strict-mode issues, and ErrorsContent select mock collision.
@otomatty otomatty merged commit 17df621 into develop Jun 11, 2026
21 checks passed
@otomatty otomatty deleted the cursor/admin-mcp-coverage-80-6b1d branch June 11, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(admin/mcp): admin と server/mcp をカバレッジ目標 80% に到達させる

2 participants