Skip to content

Commit f632985

Browse files
committed
initial frame for cow racing
1 parent bd438b7 commit f632985

4 files changed

Lines changed: 52 additions & 0 deletions

File tree

src/app/games/(games)/page.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ export default async function Games() {
5151
linktext="Boom Boom Pirate"
5252
/>
5353

54+
<GamesCard
55+
imagePath="/images/almo-border.png"
56+
title="Cow racing!"
57+
description="... ... ZOOM!"
58+
link="/games/cowrace"
59+
linktext="Cow racing!"
60+
/>
61+
5462
<GamesCard
5563
imagePath="/images/almo-border.png"
5664
title="Uno"

src/app/games/cowrace/page.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Space, Title } from "@mantine/core";
2+
import { Metadata } from "next";
3+
import Header from "@/components/header";
4+
import CowRace from "@/components/cowrace";
5+
6+
export const metadata: Metadata = {
7+
title: "Cow racing",
8+
description: "Zoom zoom cow!",
9+
openGraph: {
10+
title: "Cow Racing | Almost Yellow",
11+
description: "Zoom zoom cow!",
12+
},
13+
};
14+
15+
export default function CowRacePage() {
16+
return (
17+
<>
18+
<Header noCrumbs={true} game={true} />
19+
20+
<main id="main-content">
21+
<Title>Cow racing</Title>
22+
<Space h="xl" />
23+
<CowRace />
24+
</main>
25+
</>
26+
);
27+
}

src/components/cowrace.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"use client";
2+
3+
import { IconTractor } from "@tabler/icons-react";
4+
5+
export default function CowRace() {
6+
return (
7+
<>
8+
<IconTractor />
9+
</>
10+
);
11+
}

tests/public/01_navigation.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ test("Can navigate to the games page and through its subpages", async ({
4646
await expect(page).toHaveURL("/games/boomboompirate");
4747
await expect(page.locator("h1")).toContainText("Boom");
4848

49+
await page.getByLabel("Back to our games list").click();
50+
await page.getByRole("link", { name: "Cow racing!" }).click();
51+
await expect(page).toHaveTitle("Cow racing | Almost Yellow");
52+
await expect(page).toHaveURL("/games/cowrace");
53+
await expect(page.locator("h1")).toContainText("Cow");
54+
4955
await page.getByLabel("Back to our games list").click();
5056
await page.getByRole("link", { name: "Home" }).click();
5157
await expect(page).toHaveURL("/");

0 commit comments

Comments
 (0)