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
18 changes: 18 additions & 0 deletions src/pages/home/home-page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,22 @@ describe("HomePage", () => {
/criticalbit\.gg/i
)
})

it("links The King's Gauntlet to the aoe2 tournament path", async () => {
await renderWithFileRoutes(<></>)
expect(
screen.getByRole("link", { name: /king's gauntlet/i })
).toHaveAttribute("href", "https://aoe2.criticalbit.gg/kings-gauntlet")
})

it("orders The King's Gauntlet above Vagrant Story in the menu", async () => {
await renderWithFileRoutes(<></>)
const gauntlet = screen.getByRole("link", { name: /king's gauntlet/i })
const vagrant = screen.getByRole("link", { name: /vagrant story/i })
// bit 4 (DOCUMENT_POSITION_FOLLOWING) set => vagrant comes after gauntlet
expect(
gauntlet.compareDocumentPosition(vagrant) &
Node.DOCUMENT_POSITION_FOLLOWING
).toBeTruthy()
})
})
13 changes: 13 additions & 0 deletions src/pages/home/home-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ export function HomePage() {
onKeyDown={handleMenuKeyDown}
className="crt-menu font-pixel mt-8"
>
<li>
<a
className="crt-menu-row crt-menu-row--active"
href="https://aoe2.criticalbit.gg/kings-gauntlet"
>
<span className="crt-menu-cursor" aria-hidden>
</span>
<span>THE KING&apos;S GAUNTLET</span>
<span className="crt-menu-dots" aria-hidden />
<span>[WATCH]</span>
</a>
</li>
<li>
<a
className="crt-menu-row crt-menu-row--active"
Expand Down
Loading