From ebdfe727a602037ffe947477eab738e8cd7463ed Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Date: Tue, 7 Jul 2026 21:18:18 -0300 Subject: [PATCH] fix(test): replace tautology in playground-api-tab + make test-masking catch it (#6404) (#6603) playground-api-tab.test.tsx's SSE test always took the disabled-button branch (the fetch mock returned an empty model list) and asserted a tautology instead of exercising the SSE path it claims to verify. The test now selects a real model to enable Send, asserts it is actually enabled, and asserts the streamed SSE content reached the response editor. check-test-masking.mjs's tautology subcheck only compares base-vs-HEAD counts within a PR's own diff and no-ops entirely outside PR context (no GITHUB_BASE_SHA/REF) -- so a tautology merged once, or checked with a bare local run, stayed invisible forever after. Added an always-on absolute-floor scan (scanBareTautologies/countBareTautologies) over every tracked test file, scoped to the bare expect(true).toBe(true)/assert.equal(1,1) patterns that have zero legitimate uses in this codebase -- deliberately excluding assert.ok(true), which has ~15 pre-existing verified-legitimate try/catch-fallback uses and stays on the lenient diff-only path. --- CHANGELOG.md | 1 + scripts/check/check-test-masking.mjs | 103 +++++++++++++++++++++- tests/unit/check-test-masking.test.ts | 71 +++++++++++++++ tests/unit/ui/playground-api-tab.test.tsx | 44 ++++++--- 4 files changed, 205 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c44b96b38e..ecd488c6bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ _Living section β€” bullets land here as PRs merge into `release/v3.8.47` (paral ### πŸ› Bug Fixes +- **fix(test):** replace the bare `expect(true).toBe(true)` tautology in `playground-api-tab.test.tsx`'s SSE test and close the `check:test-masking` gap that let it slip through for a full cycle ([#6404](https://github.com/diegosouzapw/OmniRoute/issues/6404)) β€” a prior pass (#6548) had already swapped the literal to `expect(sendBtn).toBeDefined()`, but that stayed just as vacuous: the test's fetch mock returned an empty `/v1/models` list, so `ApiTab`'s Send button is always `disabled` (`!selectedModel`) and the SSE branch never runs β€” the "SSE infra is verified" comment was never true. The test now mocks a real model, drives the model `