Skip to content

Commit 5dee96b

Browse files
committed
fix(test): unblock the pre-push gate on two stale contract assertions
Both failures were red on origin/dev too, so the pre-push hook was refusing everyone's push, not just this session's. Neither is a real defect - each is a contract test that outlived the code it pins. The parity sweep gained /api/github/star from the sidebar star feature with no CLI counterpart. Rather than invent `ocx github star` to satisfy a table, the endpoint is listed as GUI-only with the reason: a one-click social action has nothing to offer a headless surface. The sweep stays exhaustive instead of silently skipping the endpoint. The account-pool assertion pinned `}, [enabled, load]);` while the effect now reads apiBase and correctly depends on it (cafdc4986) - omitting it would be the stale-closure bug the assertion exists to prevent. Updated to the real dep list; the load-bearing part, that pauseCount is absent, is unchanged and now stated in the comment. bun test tests/provider-workspace-auth.test.ts tests/cli-headless-parity.test.ts: 22 pass 0 fail.
1 parent e677dad commit 5dee96b

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

tests/cli-headless-parity.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ describe("headless GUI parity CLI", () => {
5757
["/api/claude-desktop", "ocx claude desktop"],
5858
["/api/claude/", "ocx observe"],
5959
["/api/codex-auth", "ocx account"],
60+
// GUI-only affordance: starring the repo from the sidebar. There is deliberately
61+
// no CLI mirror — the headless surface has nothing to gain from a one-click
62+
// social action, and inventing `ocx github star` would be a command nobody asked
63+
// for. Listed here so the parity sweep stays exhaustive rather than silently
64+
// skipping the endpoint.
65+
["/api/github/star", "(none — GUI-only)"],
6066
["/api/oauth", "ocx account"],
6167
["/api/providers/keys", "ocx account"],
6268
["/api/providers", "ocx provider"],

tests/provider-workspace-auth.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ describe("workspace account integration seam", () => {
209209
expect(hook).toContain("pauseTokensRef");
210210
expect(hook).toContain("if (!enabled || pauseCount > 0) return;");
211211
// The initial load must not be re-triggered by pause transitions.
212-
expect(hook).toContain("}, [enabled, load]);");
212+
// `apiBase` joined the dep list when the initial-load guard became per-base
213+
// (cafdc4986): the effect reads it, so omitting it would be the stale-closure bug
214+
// this assertion is meant to protect against. What still matters is the absence of
215+
// `pauseCount` — that is what would re-fire the initial load on every pause.
216+
expect(hook).toContain("}, [apiBase, enabled, load]);");
213217
// Reauth OAuth payload lives in the extracted OAuth hook (modal only wires props).
214218
expect(oauthHook).toContain("reauth: true");
215219
expect(oauthHook).toContain("startedReauthRef");

0 commit comments

Comments
 (0)