Skip to content

test(ui): use toHaveLength in tour-spotlight test (S5906) (#243) - #512

Merged
thomasluizon merged 1 commit into
mainfrom
chore/ui-s5906-tour-spotlight-test
Jul 14, 2026
Merged

test(ui): use toHaveLength in tour-spotlight test (S5906) (#243)#512
thomasluizon merged 1 commit into
mainfrom
chore/ui-s5906-tour-spotlight-test

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

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

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
orbit-ui-mobile-web Ignored Ignored Jul 14, 2026 5:57pm

Request Review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Complete

Scope: PR #512 in thomasluizon/orbit-ui-mobiletest(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.

@sonarqubecloud

Copy link
Copy Markdown

@thomasluizon
thomasluizon merged commit b171c1e into main Jul 14, 2026
20 checks passed
@thomasluizon
thomasluizon deleted the chore/ui-s5906-tour-spotlight-test branch July 14, 2026 18:08
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