Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/smart-teams-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
4 changes: 4 additions & 0 deletions website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export default defineConfig({
"Review code changes and collaborate with coding agents in a desktop-inspired terminal diff viewer.",
social: [{ icon: "github", label: "GitHub", href: "https://github.com/modem-dev/hunk" }],
head: [
{
tag: "script",
attrs: { defer: true, src: "/_vercel/insights/script.js" },
},
{ tag: "link", attrs: { rel: "icon", href: "/docs/favicon.svg", type: "image/svg+xml" } },
{ tag: "meta", attrs: { property: "og:type", content: "website" } },
{ tag: "meta", attrs: { property: "og:site_name", content: "Hunk documentation" } },
Expand Down
5 changes: 5 additions & 0 deletions website/tests/docs-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ test("documentation stays in the canonical light theme", async ({ page }) => {
await expect(page.locator("html")).toHaveAttribute("data-theme", "light");
});

test("documentation includes Vercel Analytics", async ({ page }) => {
await page.goto("/docs/");
await expect(page.locator('script[src="/_vercel/insights/script.js"]')).toHaveCount(1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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!

});

test("left sidebar credits Modem at its bottom", async ({ page }) => {
await page.setViewportSize({ width: 1440, height: 900 });
await page.goto("/docs/start/quick-start/");
Expand Down
Loading