diff --git a/components/PlayerCard.tsx b/components/PlayerCard.tsx index 114930d..3289fc5 100644 --- a/components/PlayerCard.tsx +++ b/components/PlayerCard.tsx @@ -2,6 +2,7 @@ import { memo, type CSSProperties } from "react"; import type { Card, StatKey } from "@/lib/scoring/types"; +import { countryName } from "@/lib/countries"; import { languageLogoUrl } from "@/lib/github/languages"; import { cardDisplayName } from "@/lib/text"; import { resolveCardTheme } from "./finishTheme"; @@ -227,7 +228,7 @@ function PlayerCard({ card }: { card: Card }) { {card.country} { + it.each([ + ["us", "United States"], + ["sct", "Scotland"], + ])("labels the %s flag with its country name", (country, expectedName) => { + const html = renderToStaticMarkup( + createElement(PlayerCard, { + card: { ...SAMPLE_CARDS[0], country }, + }), + ); + + expect(html).toContain(`alt="${expectedName}"`); + }); +});