Skip to content

test: assert the profile lightboxes survive a mousedown inside them - #1120

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-dialog-non-dismissing-backdrop
Oct 7, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-dialog-non-dismissing-backdrop

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds tests/e2e/dialog-non-dismissing.spec.js (new file, nothing else
touched): 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:

onMouseDown={(event) => event.target === event.currentTarget && onClose()}
  • src/components/MemberDirectory/MemberProfile.js line 15
  • src/components/CommunityPeople/index.js line 32

The true arm is already 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. 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 7ab301e against npm run build:e2e:coverage:

  • npx playwright test tests/e2e/dialog-non-dismissing.spec.js — 2 passed.
  • Full npm run test:e2e:coverage with the spec in place — 326 passed.
  • npm run test:unit — 1966 passed, 0 failed.
  • npx prettier --check on the new file — clean.
  • Mutation check. Replacing both handlers with a bare
    onMouseDown={() => onClose()} and rebuilding, then running
    interactions.spec.js, community-people.spec.js and
    member-directory.spec.js: 34 passed, 1 failed, the failure being
    community-people.spec.js:170 › clicking the close button closes it and restores focus on its focus-restoration assertion, which says nothing about
    the 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:coverage runs against the same build, with and without this spec:

without: src files | 100.00 | 91.41 | 2099/2099 lines | 415/454 regions
with:    src files | 100.00 | 91.25 | 2099/2099 lines | 417/457 regions

getRegionCoverage in tests/tools/e2e-coverage-report.mjs keys a region on
its 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 80 gate and
the 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 every
open 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 data
variant overlay, so no tests/e2e/fixtures/** file is touched, and no workflow
file is involved.

src/components/hooks/useFocusTrap.js line 33 is deliberately left out: it is
already 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

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>
@hivecommons-hive hivecommons-hive Bot added the hold label Oct 6, 2026
@hivecommons-hive

Copy link
Copy Markdown
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 outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@hivecommons-hive hivecommons-hive Bot added quality Approved by a Hive merger/owner for auto-merge on green CI testing Approved by a Hive merger/owner for auto-merge on green CI labels Oct 6, 2026
@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit ad4f6de Oct 7, 2026
7 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-dialog-non-dismissing-backdrop branch October 7, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold quality Approved by a Hive merger/owner for auto-merge on green CI testing Approved by a Hive merger/owner for auto-merge on green CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] the profile lightboxes' backdrop guard has no end-to-end assertion for its non-dismissing arm

1 participant