Repository navigation
test: cover websiteUrl's bare-host, unparseable and absent arms end to end - #1054
Merged
Merged
Conversation
…o end src/lib/profile-links.mjs resolves the free-text blog field of a third-party GitHub profile into an href. Three of its arms are unit-covered but unreachable in a browser against the checked-in data: the typeof guard, the no-scheme arm that resolves a bare host against https rather than concatenating it, and the URL-parser catch. Adds three staff records to the E2E_COVERAGE=1 data overlay carrying those shapes, and asserts each rendered outcome in tests/e2e/data-fixtures.spec.js. npm run build:production is unchanged: the overlay is applied only by the coverage build's loader. Closes #1053 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 automatically remove the |
This was referenced Oct 4, 2026
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
websiteUrl()insrc/lib/profile-links.mjsturns the free-textblogfieldof a third-party GitHub profile into an
href. Three of its arms are coveredby
tests/profile-links.test.mjsbut never run in a browser, because no recordin the checked-in
data/community-people.jsonhas the shape that reaches them:the
typeofguard (line 51), the no-scheme arm of the https ternary (line 55)and the URL-parser
catch(line 62). Every realblogvalue is either""oran absolute
http(s)://URL.This adds three records to the existing
E2E_COVERAGE=1overlay(
tests/e2e/fixtures/data/community-people.json) — one with noblog, onewith a bare host, one that opens with a scheme but does not parse — and asserts
each rendered outcome in
tests/e2e/data-fixtures.spec.js. The bare-host caseasserts the
hrefishttps://fixture.example/, which is the behaviour thatstops
trusted.example@attacker.examplefrom producing a link whose visibleprefix and real authority disagree; the other two assert no anchor is rendered
rather than a dead one.
npm run build:productionis untouched: the overlay is applied only by theloader the coverage build installs, and
tests/e2e/data-fixtures.spec.jsskipsitself outside
E2E_COVERAGE=1.Evidence
Measured at
900592bby building and running the whole suite locally, twice,with and without this diff — same specs, same build command, same machine
(node v26.10.0, Chromium 153.0.8010.12):
src filesThe baseline reproduces job
End-to-end coverageof run37164361552
attempt 1 to within one region (CI: 379 / 468, 80.98%), and
src/lib/profile-links.mjsis identical in both at 57.14%.Six more regions are covered. The denominator also grows by eleven, which
is why the ratio falls even though strictly more code is reached: the added
records put the component into chunk shapes that contribute further zero-count
spans over lines that demonstrably ran — the phantom-region effect #1035
reports and #1051 folds out. Rendering these same artifacts with #1051's
reporter gives
src files385 / 439 = 87.70% andsrc/lib/profile-links.mjs82.35%.The gate stays green, with less headroom
Run exactly as
.github/workflows/ci.ymlruns it:80.21% against a floor of 80 passes, but the margin drops from 0.81 to 0.21
points, so this is worth a reviewer's attention rather than being buried: on
today's reporter the floor has little room left for the next branch anyone
covers this way. Merging #1051 first removes the effect entirely (87.70%), and
#1035 already asks for the floor to be re-derived once it lands. Nothing in
this PR touches the reporter or the floor.
npm run test:unit:coverage:check→ exit 0.npm run check:format→ clean.Scope
Touches exactly two files,
tests/e2e/fixtures/data/community-people.jsonandtests/e2e/data-fixtures.spec.js. Neither appears in the diff of any openhold-gated PR: #1034 is
tests/e2e/data-variants.spec.js,tests/e2e-data-fixtures.test.mjsand thedata-variants/fixture directory(the variant build, PeopleFreshness); #1040 and #1051 are the reporter and
its tests; #1042 and #1044 are
svg-active-content; #1039 ismdx-active-content; #1048 istests/coverage-report-cli.test.mjs; #1050 isSECURITY.mdand the lockfile. The component cluster is disjoint too —src/lib/profile-links.mjsviaCommunityPeople'sPersonDialog, notPeopleFreshnessand notuseFocusTrap.Related Issue
Closes #1053
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88