Skip to content

fix(tests): unit tests catch failed saves, late responses and permission gaps - #344

Merged
MrYuion merged 5 commits into
developfrom
fix/unit-test-review
Nov 13, 2026
Merged

MrYuion merged 5 commits into
developfrom
fix/unit-test-review

Conversation

@MrYuion

@MrYuion MrYuion commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Many unit tests did not protect real behaviour. Some only checked that a mock or a signal returned what the test gave it. Important paths had no tests: failed saves, late responses after the user changed selection, permission checks, and message origin checks.

We split the app into 5 blocks (common, admin, ui, systems/modules/drivers/repositories, domains/zones/groups/users/triggers/overlays). A reviewer audited each block and reported max 20 findings: low-value tests and untested behaviour. Then a fix agent for each block deleted or rewrote the low-value tests and added one focused test for each gap. Each block then went through a review loop until the reviewer approved.

  • 92 findings, all fixed: 80 new tests for untested behaviour, and 12 low-value tests deleted or rewritten. The review loops declined 2 small items with a reason (a nit in ui, and a retry check in common that the public API cannot show).
  • Unit tests: 1075 pass (126 files). ESLint is clean. tsc -p tsconfig.spec.json has the same 14 errors as develop, and none are new.
  • Only files in src/tests changed. There are no source changes.
  • cascade-locale.spec.ts now waits for the locale strings. Before this change it sometimes failed because of a race.

Source bug found (not fixed here)

src/app/common/settings.service.ts:213: a slow save that fails can bring back an old value. If save A (columns = 4) is still in progress when save B (columns = 5) is successful, and A then fails, line 213 puts columns: 4 back into the pending changes. get() then returns 4, and the next save overwrites the saved 5. We did not add a failing test. This needs a separate fix.

Reviewed with sol-loop: 5 blocks, 1 to 2 rounds each, with gpt-6.1-sol on xhigh. Sol verdict: approved for all blocks.

Created with Claude Opus 5.5 (fix agents on xhigh) and GPT-6.1 Sol (reviews) in Claude Code through T3 Code.

🤖 Generated with Claude Code

MrYuion and others added 5 commits November 13, 2026 19:10
…ess races

Replace mock-only locale, hotkey and interface tests with tests of the real services. Wait for locale strings in the cascade locale spec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… polling

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…issions and controls

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ch selection

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… failures

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MrYuion
MrYuion merged commit bbb4ac7 into develop Nov 13, 2026
5 checks passed
@MrYuion
MrYuion deleted the fix/unit-test-review branch November 13, 2026 10:40
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