feat(nessa): add branded landing page with site-aware metadata
Add the Nessa subdomain landing page served at nessa.freno.me/. - index.tsx: hero, feature highlights, CTA band, and footer themed via useSite() brandColor and useDarkMode(); deliberately avoids freno.me web-auth UI (Nessa uses Clerk) and uses a non-fabricated 'Coming soon' CTA since there's no app-store presence yet. - meta.ts: deterministic PageHeadProps (title, description, OG) as a pure module mirroring the page-head-meta testability pattern; feature copy is derived from real nessaCommunityRouter capabilities (clubs, challenges, social.feed, events). - meta.test.ts: resolves metadata over SITE_CONFIG.nessa + pathname '/' to assert title suffix composition, canonical, OG image fallback, and description content.
This commit is contained in:
51
src/routes/nessa/meta.test.ts
Normal file
51
src/routes/nessa/meta.test.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Unit tests for the Nessa landing page metadata (task 07).
|
||||
*
|
||||
* Asserts the task-spec unit criterion: "PageHead on nessa site produces
|
||||
* correct title suffix and canonical." Mirrors the `page-head-meta.ts`
|
||||
* testability pattern — `nessa/meta.ts` is a pure module (no solid-js /
|
||||
* @solidjs/router / @solidjs/meta imports) so `bun:test` can resolve it.
|
||||
*
|
||||
* The resolved values are produced by the (task-02) `resolvePageHeadMeta`
|
||||
* helper over `NESSA_LANDING_META` + `SITE_CONFIG.nessa` + the browser
|
||||
* pathname `/` — exactly what `<PageHead>` emits on `nessa.freno.me/`.
|
||||
*/
|
||||
import { describe, it, expect } from "bun:test";
|
||||
import { resolvePageHeadMeta } from "~/components/page-head-meta";
|
||||
import { SITE_CONFIG } from "~/lib/site-context";
|
||||
import { NESSA_LANDING_META } from "./meta";
|
||||
|
||||
describe("Nessa landing page — PageHead metadata", () => {
|
||||
it("title composes to 'Nessa | Nessa' (base title + nessa titleSuffix)", () => {
|
||||
const meta = resolvePageHeadMeta(NESSA_LANDING_META, SITE_CONFIG.nessa, "/");
|
||||
expect(meta.title).toBe("Nessa | Nessa");
|
||||
});
|
||||
|
||||
it("title contains the substring 'Nessa'", () => {
|
||||
const meta = resolvePageHeadMeta(NESSA_LANDING_META, SITE_CONFIG.nessa, "/");
|
||||
expect(meta.title).toContain("Nessa");
|
||||
});
|
||||
|
||||
it("canonical is https://nessa.freno.me/ for the landing route", () => {
|
||||
const meta = resolvePageHeadMeta(NESSA_LANDING_META, SITE_CONFIG.nessa, "/");
|
||||
expect(meta.canonical).toBe("https://nessa.freno.me/");
|
||||
});
|
||||
|
||||
it("ogImage falls back to the nessa site default", () => {
|
||||
const meta = resolvePageHeadMeta(NESSA_LANDING_META, SITE_CONFIG.nessa, "/");
|
||||
expect(meta.ogImage).toBe(SITE_CONFIG.nessa.ogDefaultImage);
|
||||
});
|
||||
|
||||
it("ogTitle uses the explicit marketing copy, not the bare title", () => {
|
||||
const meta = resolvePageHeadMeta(NESSA_LANDING_META, SITE_CONFIG.nessa, "/");
|
||||
expect(meta.ogTitle).toBe(NESSA_LANDING_META.ogTitle);
|
||||
expect(meta.ogTitle).not.toBe("Nessa");
|
||||
});
|
||||
|
||||
it("description mentions community capabilities", () => {
|
||||
const meta = resolvePageHeadMeta(NESSA_LANDING_META, SITE_CONFIG.nessa, "/");
|
||||
expect(meta.description).toBe(NESSA_LANDING_META.description);
|
||||
expect(meta.description?.toLowerCase()).toContain("community");
|
||||
expect(meta.description?.toLowerCase()).toContain("challenges");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user