Files
SnapOtter/tests/e2e/sponsor-button.spec.ts
SnapOtterandGitHub 331e3bfde0 fix: reword sponsor button to "Support us" (#468)
Reword the top-nav sponsor button from "Keep it free" to "Support us" across all 21 locales and update the e2e assertion.
2026-07-10 03:34:20 +00:00

23 lines
869 B
TypeScript

import { expect, test } from "./helpers";
const SPONSOR_URL = "https://github.com/sponsors/snapotter-hq";
test.describe("Sponsor button", () => {
// Pin a desktop viewport so the full pill (with visible text) renders,
// not the mobile icon-only form.
test.use({ viewport: { width: 1280, height: 720 } });
test("top nav links to GitHub Sponsors with safe rel", async ({ page }) => {
await page.goto("/");
const link = page.locator(`a[href="${SPONSOR_URL}"]`);
await expect(link).toBeVisible();
await expect(link).toHaveAttribute("target", "_blank");
await expect(link).toHaveAttribute("rel", "noopener noreferrer");
await expect(link).toContainText(/support us/i);
await expect(link).toHaveClass(/bg-pink-50/);
await expect(link).toHaveClass(/text-pink-700/);
await expect(link).toHaveClass(/border-pink-200/);
});
});