Repository navigation
test: guard methodology /check mentions stay clickable, never plain text - #108
Conversation
The scout item (plain-text /check on /methodology) was already fixed by #90, but no test failed if a plain-text mention regressed back in. Add a guard asserting every /check mention on the methodology page is a link href or a link's anchor text.
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
📝 WalkthroughWalkthroughThe pull request adds a regression test for ChangesMethodology link validation
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc6e4d1bce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const checkUrl = `${origin}/check`; | ||
| const totalMentions = methodology.split(checkUrl).length - 1; | ||
| const hrefMentions = methodology.split(`href="${checkUrl}"`).length - 1; | ||
| const linkTextMentions = methodology.split(`>${checkUrl}<`).length - 1; |
There was a problem hiding this comment.
Require URL text to be inside an anchor
The >${checkUrl}< count treats the URL as clickable inside any element, so changing one existing <a href="…">https://…/check</a> to <span>https://…/check</span> still satisfies this equality. The earlier exact-anchor assertion also continues to pass because the methodology page contains another identical anchor, leaving the new regression detector unable to catch precisely this plain-text regression; inspect actual anchor elements or check for URL text remaining after anchors are removed instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb99e80759
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const checkUrl = `${origin}/check`; | ||
| const totalMentions = methodology.split(checkUrl).length - 1; | ||
| const hrefMentions = methodology.split(`href="${checkUrl}"`).length - 1; | ||
| const linkTextMentions = methodology.split(`>${checkUrl}<`).length - 1; |
There was a problem hiding this comment.
Ensure displayed check URLs point to the check route
If one displayed URL is changed to an anchor targeting another route, such as <a href=".../packages">https://seofixkit.com/check</a>, this guard still passes because linkTextMentions counts the text without verifying its enclosing anchor's destination; the earlier exact-anchor assertion also passes while the other identical anchor remains. This therefore misses a regression where users click a displayed /check URL but are sent to the wrong page, so each displayed URL should be validated together with its anchor's href.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffabfd7617
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const totalMentions = methodology.split(checkUrl).length - 1; | ||
| const hrefMentions = methodology.split(`href="${checkUrl}"`).length - 1; |
There was a problem hiding this comment.
Accept clickable check URLs with suffixes
When a legitimate link adds a query string or fragment, such as href="https://seofixkit.com/check?source=methodology", totalMentions still counts the /check prefix but hrefMentions requires the closing quote immediately after it, so this guard fails even though the mention remains clickable. Count parsed anchors whose resolved URL targets the check route, or otherwise allow URL suffixes, to avoid blocking valid tracking parameters and fragments.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3d7833e6e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const checkUrl = `${origin}/check`; | ||
| const totalMentions = methodology.split(checkUrl).length - 1; |
There was a problem hiding this comment.
Count relative /check mentions in the guard
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; both totalMentions and 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 /check references.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@worker/routes/pages.test.mjs`:
- Around line 54-60: Update the mention-counting assertions around
totalMentions, hrefMentions, and linkTextMentions to inspect only actual anchor
elements. Use an HTML parser or scoped anchor matcher to count matching href
attributes and anchor contents, excluding plain-text occurrences such as
paragraph text, while preserving the existing validation that the methodology
mentions the check.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 898f8ae9-e710-4429-b691-6968c6b1c875
📒 Files selected for processing (1)
worker/routes/pages.test.mjs
| const totalMentions = methodology.split(checkUrl).length - 1; | ||
| const hrefMentions = methodology.split(`href="${checkUrl}"`).length - 1; | ||
| const linkTextMentions = methodology.split(`>${checkUrl}<`).length - 1; | ||
| assert.ok(totalMentions > 0, "methodology must mention the anonymous one-page check"); | ||
| assert.equal( | ||
| totalMentions, | ||
| hrefMentions + linkTextMentions, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Count mentions inside actual anchor elements.
linkTextMentions matches any >${checkUrl}< sequence, including <p>${checkUrl}</p>. A non-clickable mention can therefore pass when another occurrence contributes a matching href count. Extract actual <a> elements with an HTML parser or a scoped matcher, then count only their href values and contents.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@worker/routes/pages.test.mjs` around lines 54 - 60, Update the
mention-counting assertions around totalMentions, hrefMentions, and
linkTextMentions to inspect only actual anchor elements. Use an HTML parser or
scoped anchor matcher to count matching href attributes and anchor contents,
excluding plain-text occurrences such as paragraph text, while preserving the
existing validation that the methodology mentions the check.
What
Scout item (2026-08-09, rank 2): "Turn the plain-text
/checkURL on/methodologyinto a real clickable CTA."Investigation showed the instance fix is already merged — PR #90 (
dbb088d, merged 2026-08-11, after the scout's observation) turned every/checkmention on the methodology page into links, including aCheck one page nowCTA. Verified on origin/main:methodologyHtml: 5 mentions of the check URL, 3 ashref, 2 as anchor text — 0 plain text.What's missing and what this PR adds
The existing tests only assert the links exist — nothing fails if a plain-text
/checkmention regresses back in. This PR adds the missing detector per the standing rule (fix the instance AND the detector): a guard asserting every/checkmention on the methodology page is either a link href or a link's anchor text. Proven to catch a simulated regression (tampered HTML with a plain-text mention fails the guard).Validation
npm run test:public-pages: 8/8 passSummary by CodeRabbit
/checkURL mentions on the methodology page are clickable.