test(ui): use toHaveLength in tour-spotlight test (S5906) (#243) - #512
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
Review Complete
Scope: PR #512 in thomasluizon/orbit-ui-mobile — test(ui): use toHaveLength in tour-spotlight test (S5906) (#243)
Recommendation: APPROVE
Summary
Single-file, single-line diff: apps/web/__tests__/components/tour/tour-spotlight.test.tsx changes expect(rects.length).toBe(1) → expect(rects).toHaveLength(1), clearing the last SonarCloud S5906 generic-assertion smell (issue #243). rects is a NodeList from querySelectorAll('svg rect'); toHaveLength operates on any object exposing a numeric .length, so the assertion is semantically identical to what it replaces — no behavior change, no new coverage, no production code touched.
Findings
Critical: None
High: None
Medium: None
Low / Info: None (nothing rose to Low; the change is a mechanical, semantics-preserving matcher swap with no defensible objection)
Subagents
| Agent | Verdict |
|---|---|
| parity-checker | N/A — the changed file is a web-only DOM/SVG RTL test exercising TourSpotlight's web-specific rendering (jsdom svg rect queries). Its React Native mirror component (apps/mobile/components/tour/tour-spotlight.tsx) already exists; the test layer has no required mirror because web (DOM/RTL) and mobile (RN Testing Library) use fundamentally different testing approaches — this is the documented "platform-specific test" parity exemption, not a gap introduced by this PR. |
| i18n-syncer | N/A — no user-facing strings touched |
| contract-aligner | N/A — no packages/shared types or orbit-api DTOs touched, no orbit-api changes in this diff |
| security-reviewer | N/A — no orbit-api code touched |
| design-reviewer | N/A — only a test assertion changed; no component markup, tokens, or styling touched |
Validation
CI's own required checks (Build / Unit Tests / SonarCloud) cover this dimension per the workflow's CI adaptation; skipped here by design.
What's good
Clean, minimal, single-purpose diff that does exactly what the PR description promises — clears the repo's last SonarCloud code smell with zero collateral risk. Good hygiene commit.
Recommendation
Merge as-is. No action required.
|



Clears the last SonarCloud code smell (S5906 generic assertion in a test #509 added) → 0 smells. Refs #243