Repository navigation
test: guard methodology /check mentions stay clickable, never plain text #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
cc6e4d1
bb99e80
ffabfd7
b3d7833
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,21 @@ test("public proof pages expose methodology and package ladder without overclaim | |
| new RegExp(`<a class="cta" href="${origin}/check">Check one page now</a>`), | ||
| "methodology must carry a clickable CTA into the anonymous one-page check" | ||
| ); | ||
| // Scout regression guard: every mention of the anonymous check URL on the | ||
| // methodology page must be clickable (a link href or a link's anchor text), | ||
| // never printed as plain text. | ||
| { | ||
| const checkUrl = `${origin}/check`; | ||
| const totalMentions = methodology.split(checkUrl).length - 1; | ||
| const hrefMentions = methodology.split(`href="${checkUrl}"`).length - 1; | ||
|
Comment on lines
+54
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a legitimate link adds a query string or fragment, such as Useful? React with 👍 / 👎. |
||
| const linkTextMentions = methodology.split(`>${checkUrl}<`).length - 1; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If one displayed URL is changed to an anchor targeting another route, such as Useful? React with 👍 / 👎. |
||
| assert.ok(totalMentions > 0, "methodology must mention the anonymous one-page check"); | ||
| assert.equal( | ||
| totalMentions, | ||
| hrefMentions + linkTextMentions, | ||
|
Comment on lines
+54
to
+60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Count mentions inside actual anchor elements.
🤖 Prompt for AI Agents |
||
| `every /check mention on the methodology page must be a clickable link (${totalMentions} mentions, ${hrefMentions} link hrefs, ${linkTextMentions} link texts)` | ||
| ); | ||
| } | ||
| assert.match(methodology, /Why not just use a free AI SEO agent skill\?/); | ||
| assert.match(methodology, /Open-source SEO tooling is good at that/, "the free-skill answer must not disparage open source"); | ||
| assert.match(methodology, /no live AI-engine sampling, no AI citation monitoring, and no ranking guarantees/i); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If an existing absolute-URL anchor is replaced with visible plain text such as
/check, this guard still passes because it counts only${origin}/check; bothtotalMentionsand the clickable counts simply decrease together, while the other identical anchor satisfies the earlier assertion. The test therefore does not enforce its stated invariant for relative mentions of the same route, so it should inspect rendered text for both absolute and relative/checkreferences.Useful? React with 👍 / 👎.