Fix StandingsPreview test ambiguous text query for team names

FlagSvg renders a <title> element with the team name for accessibility,
so getByText("Team Alpha") matched two elements. Scope the query to the
<p> element to target only the visible team name display.

https://claude.ai/code/session_01CVt5Vo2PDGY4G3wSWbsmRG
This commit is contained in:
Claude 2026-05-07 01:04:08 +00:00
parent a26294446d
commit d8e5be4558
No known key found for this signature in database

View file

@ -70,8 +70,10 @@ describe("StandingsPreview", () => {
];
renderWithRouter(<StandingsPreview entries={entries} />);
expect(screen.getByText("Team Alpha")).toBeInTheDocument();
expect(screen.getByText("Team Beta")).toBeInTheDocument();
// Use selector to target only the <p> element — the team name also appears
// in the SVG <title> for accessibility, causing multiple matches otherwise.
expect(screen.getByText("Team Alpha", { selector: "p" })).toBeInTheDocument();
expect(screen.getByText("Team Beta", { selector: "p" })).toBeInTheDocument();
});
it("renders owner name below team name", () => {