Skip to content

testing: cover link behavior#374

Merged
RtlZeroMemory merged 2 commits intomainfrom
feature/testing-link-behavior
Apr 15, 2026
Merged

testing: cover link behavior#374
RtlZeroMemory merged 2 commits intomainfrom
feature/testing-link-behavior

Conversation

@RtlZeroMemory
Copy link
Copy Markdown
Owner

@RtlZeroMemory RtlZeroMemory commented Apr 14, 2026

Summary

  • add app-level link mouse behavior coverage for hit-tested click focus and press routing
  • cover the default label -> url fallback at integration fidelity so the visible text and click path stay aligned

Families Covered

  • link

Tests Added, Rewritten, Removed

  • added app-level integration coverage in packages/core/src/app/__tests__/widgetRenderer.integration.test.ts for unlabeled link mouse focus + press
  • added app-level integration coverage in the same file for disabled-link mouse click no-op behavior
  • rewrote no existing tests in this PR
  • removed no tests in this PR

Implementation Bugs Fixed

  • none; the behavior-first tests passed once added

Commands Run

  • ./node_modules/.bin/tsc -b packages/core/tsconfig.json --pretty false
  • node --test packages/core/dist/app/__tests__/widgetRenderer.integration.test.js packages/core/dist/widgets/__tests__/basicWidgets.render.test.js packages/core/dist/runtime/__tests__/widgetMeta.test.js packages/core/dist/renderer/__tests__/focusIndicators.test.js

Unresolved Areas Left Explicit

  • broader navigation widgets (tabs, accordion, breadcrumb, pagination) still need separate contract selection and should not be inferred from this link slice
  • hyperlink metadata emission and older-builder degradation remain covered at lower-level render fidelity rather than app-level routing fidelity

Dependency Note

  • none

Summary by CodeRabbit

  • Tests
    • Added integration tests for link mouse and focus behavior: verifies links without explicit labels render visible URL text, ensure mouse-down sets focus without triggering activation, and mouse-up produces a press action and increments press count while maintaining focus.
    • Added tests for disabled links confirming mouse interactions produce no action, onPress is not called, and focus remains unset.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4f26cc42-2d35-4e78-925a-33005c413c59

📥 Commits

Reviewing files that changed from the base of the PR and between 28baa93 and d0d5fb0.

📒 Files selected for processing (1)
  • packages/core/src/app/__tests__/widgetRenderer.integration.test.ts

📝 Walkthrough

Walkthrough

Added two integration tests for WidgetRenderer link mouse interactions: one verifies focus and press semantics for a link with no label (URL text used, onPress triggered on mouseup), the other verifies that a disabled link ignores mouse interactions and remains unfocused.

Changes

Cohort / File(s) Summary
Link Widget Integration Tests
packages/core/src/app/__tests__/widgetRenderer.integration.test.ts
Added two integration tests: (1) link without label — renders URL text, mousedown focuses without triggering onPress, mouseup emits { id, action: "press" } and increments onPress; (2) disabled link — mousedown/mouseup produce no action, onPress not called, focus stays null.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I hopped through tests with whiskers bright,
Clicking links by day and night,
One wakes on release, one stays asleep,
Focus found, disabled silence to keep,
A tiny rabbit's QA delight.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'testing: cover link behavior' directly and accurately describes the main purpose of the PR, which adds integration tests for link widget mouse interactions and behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/testing-link-behavior

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/core/src/app/__tests__/widgetRenderer.integration.test.ts`:
- Around line 1054-1074: The new test block's formatting does not match the
project's Biome formatter; run the project's formatter (Biome) or "npm run
format" and reformat the test lines around the
createTestRenderer/render/mouseEvent usage (references: createTestRenderer,
renderer.getRectByIdIndex, renderer.routeEngineEvent, mouseEvent, clickX,
clickY) so the whitespace/line breaks match the repo style; apply the same
formatting fix to the other affected range (around lines using the same test
pattern referenced as also applies to: 1152-1155) and commit the formatted
changes to unblock CI.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4aad20c6-4b8d-4c09-8297-62c008db8c30

📥 Commits

Reviewing files that changed from the base of the PR and between 9df8069 and 28baa93.

📒 Files selected for processing (1)
  • packages/core/src/app/__tests__/widgetRenderer.integration.test.ts

Comment thread packages/core/src/app/__tests__/widgetRenderer.integration.test.ts Outdated
@RtlZeroMemory RtlZeroMemory force-pushed the feature/testing-link-behavior branch from 28baa93 to d0d5fb0 Compare April 15, 2026 07:04
@RtlZeroMemory RtlZeroMemory merged commit dc8f5cb into main Apr 15, 2026
12 checks passed
@RtlZeroMemory RtlZeroMemory deleted the feature/testing-link-behavior branch April 15, 2026 07:12
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