Repository navigation
test: assert the profile lightboxes survive a mousedown inside them - #1120
Merged
Merged
Conversation
Both profile lightboxes guard dismissal with the handler bound to the
backdrop rather than the dialog box:
onMouseDown={(event) => event.target === event.currentTarget && onClose()}
at src/components/MemberDirectory/MemberProfile.js:15 and
src/components/CommunityPeople/index.js:32. The true arm is driven in a
browser by tests/e2e/interactions.spec.js:261 and
tests/e2e/community-people.spec.js:181, which click a coordinate clear of
the dialog. The false arm -- a mousedown that starts on a descendant and
bubbles up to the backdrop -- had no end-to-end assertion.
Replacing both handlers with a bare onMouseDown={() => onClose()} and
rebuilding leaves 34 of the 35 cases in the three specs that drive these
dialogs green; the one failure is a focus-restoration assertion that says
nothing about the guard.
Closes #1119
Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
3 tasks
This was referenced Oct 6, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
Adds
tests/e2e/dialog-non-dismissing.spec.js(new file, nothing elsetouched): two cases that open each profile lightbox, click the dialog's own
heading, and assert the dialog is still there.
Both lightboxes guard dismissal with the handler bound to the backdrop
rather than the dialog box:
src/components/MemberDirectory/MemberProfile.jsline 15src/components/CommunityPeople/index.jsline 32The true arm is already driven in a browser by
tests/e2e/interactions.spec.js:261andtests/e2e/community-people.spec.js:181, which click a coordinate clear of thedialog. The false arm — a mousedown that starts on a descendant and bubbles up
to the backdrop — had no end-to-end assertion. Each case clicks the heading
rather than a coordinate, so it cannot pass by missing the backdrop altogether,
then presses Escape to show the dialog was still dismissible, so the assertion
is the guard declining to close rather than a detached handler.
Verification
Run locally at
7ab301eagainstnpm run build:e2e:coverage:npx playwright test tests/e2e/dialog-non-dismissing.spec.js— 2 passed.npm run test:e2e:coveragewith the spec in place — 326 passed.npm run test:unit— 1966 passed, 0 failed.npx prettier --checkon the new file — clean.onMouseDown={() => onClose()}and rebuilding, then runninginteractions.spec.js,community-people.spec.jsandmember-directory.spec.js:34 passed, 1 failed, the failure beingcommunity-people.spec.js:170 › clicking the close button closes it and restores focuson its focus-restoration assertion, which says nothing aboutthe guard. Both new cases fail on the dialog disappearing.
What this does not do
It does not clear lines 15 and 32 from the e2e uncovered-region list, and
it lowers the headline region percentage very slightly. Two full
test:e2e:coverageruns against the same build, with and without this spec:getRegionCoverageintests/tools/e2e-coverage-report.mjskeys a region onits mapped original coordinates, and dumping the keys for these files shows the
executed arm arriving under a different key than the zero one — the attribution
limit tracked by #1066 and #1079. The suite reaching further also surfaces
extra V8 block ranges, moving the denominator from 454 to 457; that is the
moving-denominator effect described in #1105, reproduced with no variant
overlay involved. Both figures clear the
--check-source-regions 80gate andthe 86 proposed in #1105.
The value here is the regression assertion, not a coverage number, and the
issue says so as well.
Coordination
One new file,
tests/e2e/dialog-non-dismissing.spec.js. Disjoint from everyopen hold-gated PR: #1090 (
scripts/lib/svg-active-content.mjs), #1112(
package.json), #1104 (member-directory-freshness-variant.spec.js), #1110(
e2e-data-fixtures), #1113 (GroupLinkStatus), #1114(
tests/e2e-coverage-report.test.mjs), #1117 (MetricsDashboard). No datavariant overlay, so no
tests/e2e/fixtures/**file is touched, and no workflowfile is involved.
src/components/hooks/useFocusTrap.jsline 33 is deliberately left out: it isalready driven end to end by
tests/e2e/community-people.spec.js:244.Related Issue
Closes #1119
Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88