Skip to content

test(Popover): pointer and keyboard hybrid interaction (#1814)#2090

Merged
kodiakhq[bot] merged 3 commits into
mainfrom
test/issue-1814-popover-hybrid-interaction
Jun 24, 2026
Merged

test(Popover): pointer and keyboard hybrid interaction (#1814)#2090
kodiakhq[bot] merged 3 commits into
mainfrom
test/issue-1814-popover-hybrid-interaction

Conversation

@kotAPI

@kotAPI kotAPI commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

cover mixed pointer and keyboard interaction paths

Test plan

  • Related unit tests pass locally

Related to #1814

Summary by CodeRabbit

  • Tests
    • Added coverage for Popover hybrid interactions, including mouse and keyboard opening flows.
    • Verified Escape key dismissal returns focus to the trigger.
    • Verified closing via the Popover control removes the dialog.
    • Improved test stability by mocking responsive media-query behavior in browser-like test environments.

@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ccf3374

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bda0214d-f0d9-4686-832c-7b2850df605c

📥 Commits

Reviewing files that changed from the base of the PR and between e2e163f and ccf3374.

📒 Files selected for processing (1)
  • src/components/ui/Popover/tests/Popover.hybridInteraction.test.tsx

📝 Walkthrough

Walkthrough

A new test file Popover.hybridInteraction.test.tsx is added with two async tests covering mixed input-mode flows: opening via pointer click and closing with the Escape key (asserting focus returns to trigger), and opening via keyboard Space and closing via pointer click on the close control.

Changes

Popover Hybrid Interaction Tests

Layer / File(s) Summary
Test setup and describe scaffold
src/components/ui/Popover/tests/Popover.hybridInteraction.test.tsx
Imports React Testing Library utilities, defines mockMatchMedia() to stub window.matchMedia in JSDOM, and wires it into a beforeEach inside the new describe block.
Hybrid open/close test cases
src/components/ui/Popover/tests/Popover.hybridInteraction.test.tsx
Adds two async tests: pointer-click opens then Escape closes (asserts trigger regains focus), and keyboard Space opens then pointer click on Popover.Close dismisses (asserts dialog is removed from DOM).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Poem

🐇 A click to open, Escape to flee,
Space to summon, a close sets free,
The dialog pops and focus returns just right,
Hybrid gestures tested through day and night,
No matchMedia left to break the scene —
The fluffiest tests you've ever seen! 🌸

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: Popover hybrid pointer and keyboard interaction tests for issue #1814.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 test/issue-1814-popover-hybrid-interaction

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: one or more packages not found in the registry.


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

@kotAPI

kotAPI commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

Code review

Reviewed and pushed follow-up fixes addressing handler composition, test patterns (rerender vs unmount), Theme/mockMatchMedia wrappers, and flaky focus assertions.

CI was green before fixes; please re-run checks on latest commit.

@GoldGroove06 GoldGroove06 added the automerge A tag that tells kodiak bot to automerge PRs for us when tests and approval conditions are met label Jun 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage

This report compares the PR with the base branch. "Δ" shows how the PR affects each metric.

Metric PR Δ
Statements 78.32% +0.00%
Branches 61.17% +0.00%
Functions 63.7% +0.00%
Lines 79.91% +0.00%

Coverage improved or stayed the same. Great job!

Run npm run coverage:ci locally for detailed reports and target untested areas to raise these numbers.

@kodiakhq kodiakhq Bot merged commit dd8bc14 into main Jun 24, 2026
11 of 12 checks passed
@kodiakhq kodiakhq Bot deleted the test/issue-1814-popover-hybrid-interaction branch June 24, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge A tag that tells kodiak bot to automerge PRs for us when tests and approval conditions are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants