fix(website): track documentation visits - #620
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
||
| test("documentation includes Vercel Analytics", async ({ page }) => { | ||
| await page.goto("/docs/"); | ||
| await expect(page.locator('script[src="/_vercel/insights/script.js"]')).toHaveCount(1); |
There was a problem hiding this comment.
Analytics test checks markup only
toHaveCount(1) verifies only that the script element was generated, so the test remains green when /_vercel/insights/script.js fails to load and cannot catch a deployment regression that leaves documentation visits untracked.
Context Used: testing.mdc Cursor rule (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: website/tests/docs-smoke.spec.ts
Line: 40
Comment:
**Analytics test checks markup only**
`toHaveCount(1)` verifies only that the script element was generated, so the test remains green when `/_vercel/insights/script.js` fails to load and cannot catch a deployment regression that leaves documentation visits untracked.
**Context Used:** testing.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/testing.mdc))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Greptile SummaryThis PR fixes IPv6 URL-authority formatting for the local session broker and adds Vercel Insights to documentation pages.
Confidence Score: 4/5The PR appears safe to merge, although the analytics regression test should verify resource loading rather than only script-tag presence. The IPv6 origin formatting is consistent with URL and socket hostname requirements, while the only accepted concern is non-blocking test coverage that remains green when the analytics endpoint fails. Files Needing Attention: website/tests/docs-smoke.spec.ts Important Files Changed
Prompt To Fix All With AI### Issue 1
website/tests/docs-smoke.spec.ts:40
**Analytics test checks markup only**
`toHaveCount(1)` verifies only that the script element was generated, so the test remains green when `/_vercel/insights/script.js` fails to load and cannot catch a deployment regression that leaves documentation visits untracked.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(website): track documentation visits" | Re-trigger Greptile |
bc209f5 to
36a6af8
Compare
Summary
Verification
cd website && bun run checkcd website && bun run build/docs/This PR description was generated by Pi using OpenAI GPT-5.2