Skip to content

test(mock): the improve mock test owns its Console state - #53

Merged
reoring merged 1 commit into
mainfrom
fix/mock-improve-console-state
Dec 4, 2026
Merged

reoring merged 1 commit into
mainfrom
fix/mock-improve-console-state

Conversation

@reoring

@reoring reoring commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Problem

web fails intermittently on main (run 47285713094 attempt 1, and PR #52 attempt 1): mock-improve.test.ts › question → proposal → run → review gets 403 instead of 200.

mock-improve.test.ts routes only through the Platform mock, but the reviewer decision is authorized from the Console mock's state (caller and app owner). mock-conversation-setting.test.ts switches the caller and leaves it switched. Deterministic on adb14e3:

bun test src/dev/mock-conversation-setting.test.ts src/dev/mock-improve.test.ts   # 11 pass / 1 fail

Change (tests only)

  • mock-improve.test.ts resets both mocks before each test, the same shape as mock-proposals.test.ts.
  • mock-conversation-setting.test.ts resets the Console mock after each test.

No assertion changed.

Verification

  • The pair above, in both argument orders: 12 pass / 0 fail.
  • bun test src/dev: 123 pass / 0 fail. bun run typecheck: clean.

console-mock-stories is flaky for a separate, uninvestigated reason (a different story each run); this PR does not touch it.

mock-improve.test.ts routed only through the Platform mock, but the reviewer decision is
authorized from the Console mock's caller and owner. mock-conversation-setting.test.ts left
the caller switched, so the pair failed with 403 whenever it ran in that order.

- mock-improve.test.ts resets both mocks before each test (same shape as mock-proposals).
- mock-conversation-setting.test.ts resets the Console mock after each test.
@reoring
reoring merged commit bfc0925 into main Dec 4, 2026
4 of 5 checks passed
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.

1 participant