Skip to content

test: cover the member directory's four undriven toolbar controls - #1060

Merged
castrojo merged 1 commit into
mainfrom
quality/e2e-member-directory-facets
Oct 6, 2026
Merged

castrojo merged 1 commit into
mainfrom
quality/e2e-member-directory-facets

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

The member directory toolbar on /community/members carries six controls — a
search box, three <select>s and two checkboxes — and a browser had driven only
two of them. tests/e2e/interactions.spec.js's member directory filtering
block fills Search organizations by name and selects a Filter by
membership status
; nothing in tests/e2e/** touched Filter by industry,
Filter by CNCF project, Has architecture or Has award.

This adds a member directory facet filtering block to
tests/e2e/member-directory.spec.js giving each of the four the same
select-or-check / narrow / clear cycle. Each test asserts the control starts
empty or unchecked, drives it, asserts the shown count lands strictly
between 1 and the total, clicks Clear filters, and asserts both the count
and the control return to their starting state. The strict upper bound is what
proves the return false arm ran rather than only the arm that renders
everything.

What this reaches

Eight regions of src/components/MemberDirectory/index.js that only the unit
suite's fake DOM reached:

line code
31 if (industry && !member.industries.includes(industry)) {
34 if (project && !member.projects.includes(project)) {
40 if (hasArchitecture && member.architectures.length === 0) {
43 if (hasAward && member.awards.length === 0) {
101 onChange={(event) => setIndustry(event.target.value)}
140 onChange={(event) => setProject(event.target.value)}
155 onChange={(event) => setHasArchitecture(event.target.checked)}
163 onChange={(event) => setHasAward(event.target.checked)}

101, 140, 155 and 163 are the wiring a fake DOM cannot vouch for: each control
is bound to its own useState setter through its own htmlFor/id pair or its
own checked prop. A duplicated id, an option list built from the wrong
field, or a handler wired to the neighbouring setter leaves the shipped toolbar
inert on that control while the search and membership tests stay green.

No data overlay

In data/members.json at this revision the alphabetically-first industry
(Cloud) and project (Agones) each match exactly 1 of 101 members, 7 members
carry an architecture and 13 carry an award — every control narrows strictly.
The facet value is read off the page's own <option> list at index 1 (index 0
is the "All ..." placeholder) rather than from a data file, so the test does not
care whether the build used the real document or the coverage overlay, and a
regenerated members.json cannot silently stop exercising the branch.

Evidence

Reproduced at 900592b by building and running the suite locally
(npm run build:e2e:coverage, then node tests/tools/e2e-coverage-run.mjs init,
npm run test:e2e:coverage with E2E_COVERAGE_DIR/E2E_COVERAGE_RUN_ID set,
then seal), and rendering the report with --build build.

  • Before — job End-to-end coverage, workflow Validate repository, run
    37164361552
    attempt 1, revision 900592b; artifact e2e-coverage (id 11289266192),
    manifest runId 37164361552-1, status: passed,
    sealedAt 2026-10-04T00:19:14Z. report.txt puts
    src/components/MemberDirectory/index.js at 100.00% lines / 80.95%
    regions
    , uncovered region lines [31, 34, 40, 43, 101, 140, 155, 163];
    src files at 80.98% (379/468 regions).
  • After — the local run on this branch, 298 baseline specs plus the 4 added
    here, 302 passed. The same file renders at 100.00% lines / 100.00%
    regions
    , no uncovered regions; src files 82.77% (389/470 regions).
    (The region denominator drifts by a region or two between runs for the reason
    test: fold out phantom e2e coverage regions over covered lines #1051 documents; the per-file result does not.)

npm run check:format passes. Unit coverage is unchanged and not involved: at
the same revision npm run test:unit:coverage already reports this file at
100.00% lines / 100.00% regions, which is why the gap was end-to-end only.

Scope

Touches tests/e2e/member-directory.spec.js only — no production code, no data
fixture, no coverage tooling. Disjoint from every open hold-gated PR: #1051 and
#1040 are in tests/tools/e2e-coverage-report.mjs, #1034 and #1054 are in the
tests/e2e/fixtures/** overlays with data-variants.spec.js /
data-fixtures.spec.js, #1058 is in tests/e2e/interactions.spec.js for the
separate ArchitectureFilters component, and #1039/#1042/#1044/#1048/#1050/#1056
are elsewhere entirely. No other open PR references MemberDirectory or
member-directory.spec.js.

Related Issue

Closes #1059


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

The directory toolbar on /community/members carries six controls and a browser
had driven only two: interactions.spec.js fills the search box and selects a
membership status. The industry select, the project select and the
Has architecture / Has award toggles were reached by the unit suite's fake DOM
alone, which cannot vouch for a control being wired to the setter its label
claims.

Adds a facet-filtering block giving each of the four the same
select-or-check / narrow / clear cycle the membership select already gets,
covering src/components/MemberDirectory/index.js lines 31, 34, 40, 43, 101,
140, 155 and 163. No data overlay is needed: each control narrows strictly
against the shipped data, so both arms of each guard run, and the facet value
is read off the page's own option list rather than a data file.

Closes #1059

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive hivecommons-hive Bot added the hold label Oct 4, 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 automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@castrojo
castrojo added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit 841e79b Oct 6, 2026
7 checks passed
@mrbobbytables
mrbobbytables deleted the quality/e2e-member-directory-facets branch October 7, 2026 15:16
mrbobbytables added a commit to mrbobbytables/endusers that referenced this pull request Oct 8, 2026
The last completion criterion of cncf#1079: re-derive --check-source-regions
from the corrected number after cncf#1163 folded the crossing-region
source-map drift the issue measured.

A full local run of the pipeline (build:e2e:coverage, 340 passing specs,
seal, report) at main measures source regions at 95.22% (438/460), up
from the 80.98% that set the current floor of 91's predecessor. The
three regions cncf#1079 proved executed (MemberProfile.js 10 and 15,
MemberCard.js 75) now fold, and MemberDirectory/index.js 31/34/40/43
are covered for real since cncf#1060 merged.

Following the established ratchet pattern (measured 91.63 -> floor 91
in cncf#1105), the floor becomes floor(95.22) = 95. Updated in the same
change, as tests/e2e-coverage-gate.test.mjs instructs: the workflow
gate, the FLOORS guard and its fixtures, the workflow-scripts gating
assertion, and the CONTRIBUTING.md recipe.

Closes cncf#1079

Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
Co-authored-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] the member directory's industry, project and has-architecture/has-award controls have no end-to-end coverage

1 participant