test+docs: add inspectorTabs test; document mid-session auth modules

- Add a dedicated `inspectorTabs.test.ts` (was relying only on incidental
  coverage from App.test.tsx) — covers the tab-id constants and both branches
  of the `isInspectorTabId` type guard; 100% per-file.
- AGENTS.md: extend the `core/auth/` structure-tree entry to describe the new
  mid-session recovery modules (challenge parsing, scope union, shared OAuth UX
  copy, force-reauthorization) and the node loopback callback flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZyeWManYTvcXxjcrhxSQc
This commit is contained in:
cliffhall 2026-07-03 13:20:29 -04:00
commit 143e0d3f71

View file

@ -0,0 +1,38 @@
import { describe, it, expect } from "vitest";
import {
INSPECTOR_SERVERS_TAB,
INSPECTOR_TAB_IDS,
isInspectorTabId,
} from "./inspectorTabs";
describe("inspectorTabs", () => {
it("names the Servers tab, which is not a liftable inspector tab", () => {
expect(INSPECTOR_SERVERS_TAB).toBe("Servers");
expect(INSPECTOR_TAB_IDS).not.toContain(INSPECTOR_SERVERS_TAB);
});
it("enumerates the liftable inspector tabs", () => {
expect(INSPECTOR_TAB_IDS).toEqual([
"Apps",
"Tools",
"Prompts",
"Resources",
"Tasks",
"Logs",
"History",
"Network",
]);
});
it("isInspectorTabId returns true for every enumerated tab", () => {
for (const tab of INSPECTOR_TAB_IDS) {
expect(isInspectorTabId(tab)).toBe(true);
}
});
it("isInspectorTabId returns false for non-inspector tab values", () => {
expect(isInspectorTabId(INSPECTOR_SERVERS_TAB)).toBe(false);
expect(isInspectorTabId("")).toBe(false);
expect(isInspectorTabId("Bogus")).toBe(false);
});
});