bugfix: await the websocket visibility assertion so it actually runs#8317
Conversation
The 'websocket requests are visible' test calls expect(page.locator(...)).toBeVisible() without awaiting it. A Playwright web-first matcher returns a Promise that polls and retries until the element matches or the timeout elapses. When the expect is not awaited the Promise is created and immediately discarded, so the assertion never runs and the test passes whether or not the request is visible in the sidebar. This is the sole assertion in that test, so the test gave no real coverage. The six other expect calls in the same file are already awaited, so this brings the line in line with the file's own idiom. Signed-off-by: YONGJAE LEE <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughA single-character fix in ChangesWebSocket Test Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
The first websocket E2E test, 'websocket requests are visible', has its only
assertion floating without an await:
expect(locator).toBeVisible()is a Playwright web-first matcher: it returns aPromise that polls and retries until the element is visible or the timeout
elapses. Because the call is not awaited, the Promise is created and discarded,
the assertion never runs, and the test passes whether or not the websocket
request is actually visible in the sidebar. Since this is the sole assertion in
the test, the test provided no real coverage.
The other six
expect(...)calls in the same file are all already awaited, sothis is the one line that drifted from the file's own idiom.
The coding standards already flag this class of issue: CODING_STANDARDS.md calls
out "fake assertions" and "fake internal state checks" as things to avoid in
tests. A web-first matcher that is never awaited is exactly that, a check that
looks like an assertion but enforces nothing.
The fix adds the missing
await:Scope is intentionally limited to this one missing-await in this one file. No
test titles, selectors, or behavior are changed.
Verified locally
Re-fetched and reviewed against main on 2026-06-20. Ran the repository preflight
against the changed spec:
Not run locally: the Playwright websocket E2E suite, TypeScript, and lint. This
clone has no installed dependencies, so the preflight skipped the spec run, tsc,
and eslint. The change is a one-character assertion strengthening within an
existing test and adds no new code paths.
Contribution Checklist:
Found while reviewing the test suite with
e2e-skills/e2e-reviewer.Summary by CodeRabbit