Repository navigation
test: let data overlays patch a root-level JSON array with setWhere - #1110
Merged
Merged
Conversation
tests/tools/e2e-data-fixtures.cjs addresses data through dotted paths walked down from a root object, so parentOf() rejected an array at every step. That left the two data files whose root is a JSON array -- data/architectures/catalog.json and data/projects-born.json -- outside the overlay mechanism entirely, with no path that reaches into either. Add a setWhere overlay key that selects one record of a top-level array by <field>=<value> and patches its fields. It keeps the fail-loud property the dotted paths have: a selector matching no record, matching more than one, or naming a field the record does not carry is an error rather than a silent no-op, so a regenerated data file breaks the build instead of quietly dropping the coverage it was written for. The selector is keyed on a field rather than a positional index because both files are regenerated and their entry order is not stable. Use it to empty one catalog entry's industries in the coverage build, so ArchitectureCard renders the 'Reference architecture' eyebrow fallback (src/components/ReferenceArchitectures/index.js:66). Every shipped entry carries a non-empty industries array, so that arm has never rendered in a browser. This is an additive case rather than a swap: the other seven entries keep their industries, so both arms of the || render on the same page in the same build and no variant build is needed. Closes #1086 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> 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 |
…ction docs/architectures/index.md renders <ReferenceArchitectures /> inside a docs page whose autogenerated sidebar links every sibling architecture page. An unscoped a[href$="/architectures/<id>"] therefore matched the sidebar entry as well as the card, and toHaveCount(1) saw 2. Scope both locators to the component's own landmark, <section aria-label="Reference architecture catalog">, and pin the populated arm with its own toHaveCount(1): the adobe id matched three elements page-wide, so that assertion would have tripped strict mode next. Verified against build/architectures/index.html from a local E2E_COVERAGE=1 build: 2 allianz hrefs page-wide, exactly 1 inside the catalog section, and the fallback card does render the generic "Reference architecture" eyebrow. Signed-off-by: quality <quality@hive.kubestellar.io>
This was referenced Oct 6, 2026
Closed
Closed
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
tests/tools/e2e-data-fixtures.cjsaddressed data through dotted paths walkeddown from a root object, so
parentOf()rejected an array at every step. Thatleft the two data files whose root is a JSON array —
data/architectures/catalog.jsonand
data/projects-born.json— outside the overlay mechanism entirely.tests/tools/e2e-data-fixtures.cjs— newsetWhereoverlay key. It selectsone record of a top-level array by
<field>=<value>and patches its fields,keeping the fail-loud property the dotted paths have: a selector matching no
record, matching more than one, or naming a field the record does not carry is
an error rather than a silent no-op. It is keyed on a field rather than a
positional index because both files are regenerated (
npm run import:architectures,npm run collect:projects-born) and entry order is not stable.tests/e2e/fixtures/data/architectures/catalog.json— new overlay emptyingallianz'sindustries, soArchitectureCardrenders the eyebrow fallback atsrc/components/ReferenceArchitectures/index.js:66. This is an additive case,not a swap: the other seven entries keep their industries, so both arms of the
||render on the same page in the same build. No variant build is needed.tests/e2e/data-fixtures.spec.js— one spec driving the fallback card andthe populated card on the same page, so the assertion is evidence the branch
switched rather than that every eyebrow went generic.
tests/e2e-data-fixtures.test.mjs— pinssetWhere's patch semantics andeach of its six rejections; pins that both root-array data files are now
addressable against the real files; adds the catalog overlay to the
"every committed overlay still applies" case, both directions.
tests/e2e-data-fixtures.test.mjs:85-91("setting a leaf whose parent is anarray is rejected") is unchanged — leaf-under-array addressing stays rejected.
Verification
npm run test:unit— 1975 passed, 0 failed at7ab301e+ this diff.npm run build:e2e:coverage— succeeds. The built coverage site server-rendersthe fallback:
build/architectures/index.htmlcontains<a class=card_D3WH href=/architectures/allianz>…<p class=eyebrow_MUlS>Reference architecture,while the other cards still render their joined industries.
npx prettier --check tests/— clean.libglib-2.0.so.0, sochrome-headless-shellexits 127 before any navigation,and all seven pre-existing specs in that file fail identically. That is
environmental, not diff-local; CI's
End-to-end coveragejob is the first runof the new case.
Scope
Only
tests/**. No production code, no workflow file.--check-source-regionsneeds no change: this adds a covered region without adding a build.
Disjoint from the open hold-gated PRs — #1090 is
scripts/lib/svg-active-content.mjs,#1104 is
tests/e2e/fixtures/data-variants/members.jsonplus its own spec file.Neither touches
tests/tools/e2e-data-fixtures.cjs,tests/e2e-data-fixtures.test.mjs,tests/e2e/data-fixtures.spec.jsortests/e2e/fixtures/data/architectures/.Also disjoint from the
tests/tools/e2e-coverage-report.mjsregion-attributioncluster (#1066, #1079, #1097).
Related Issue
Closes #1086
Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88