Skip to content

visitAllLinks: skip links the SPA router never handles - #131

Merged
NullVoxPopuli merged 1 commit into
mainfrom
skip-non-spa-links
Jul 28, 2026
Merged

NullVoxPopuli merged 1 commit into
mainfrom
skip-non-spa-links

Conversation

@NullVoxPopuli

@NullVoxPopuli NullVoxPopuli commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

findInAppLinks collected every same-origin anchor, but anchors with target (e.g. _blank), download, rel="external", or a non-http(s) scheme (mailto:, tel:) are handled natively by the browser — a new tab, a download dialog, an external protocol handler. Clicking them under the test harness can never change currentURL(), so the crawl reported each one as a failed navigation (Navigation was successful with the unchanged URL as actual).

Found crawling AuditBoard's docs app, whose homepage links a statically hosted audit report via target="_blank" — a perfectly working link that failed the crawl.

Instead of hand-mirroring the rules, the crawler now uses should-handle-link directly — the predicate @properLinks uses to decide whether the router handles a click — with a fabricated plain left-click MouseEvent to satisfy the event-modifier checks. So the crawler visits exactly the set of links the router would handle, and stays in lockstep with properLinks as its rules evolve. Its origin comparison also subsumes the old startsWith('http') heuristic (and covers mailto:/tel: via the null origin). SVG <a> elements are skipped — their href is an SVGAnimatedString neither the router nor shouldHandle can work with.

Tests: the test-app's application template now renders all four non-SPA link kinds; without the fix, both All Links acceptance tests fail (the crawler clicks the target="_blank" link and reports a failed navigation), with it the suite is 6/6.

🤖 Generated with Claude Code

@NullVoxPopuli NullVoxPopuli added the bug Something isn't working label Jul 28, 2026
Anchors with target (e.g. _blank), download, rel="external", or a
non-http(s) scheme (mailto:, tel:) are handled natively by the browser
— a new tab, a download dialog, an external protocol handler. Clicking
them in a test can never change currentURL(), so the crawl reported
every one of them as a failed navigation ('Navigation was successful'
pushResult with the unchanged URL as actual).

Found crawling AuditBoard's docs app, whose homepage links a statically
hosted report via target="_blank".

Rather than hand-mirroring the rules, the crawler uses
should-handle-link directly — the predicate ember-primitives'
@properLinks uses to decide whether the router handles a click — with a
fabricated plain left-click MouseEvent to satisfy the event-modifier
checks. Its origin comparison also subsumes the old startsWith('http')
heuristic (and covers mailto:/tel: via the null origin). SVG anchors
are skipped: their href is an SVGAnimatedString neither the router nor
shouldHandle can work with.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@NullVoxPopuli
NullVoxPopuli merged commit 432bc74 into main Jul 28, 2026
2 checks passed
@NullVoxPopuli
NullVoxPopuli deleted the skip-non-spa-links branch July 28, 2026 18:41
@github-actions github-actions Bot mentioned this pull request Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant