diff --git a/app/components/sport-season/__tests__/RegularSeasonStandings.test.tsx b/app/components/sport-season/__tests__/RegularSeasonStandings.test.tsx index 3911fd7..9e8cee1 100644 --- a/app/components/sport-season/__tests__/RegularSeasonStandings.test.tsx +++ b/app/components/sport-season/__tests__/RegularSeasonStandings.test.tsx @@ -1,5 +1,5 @@ import { describe, it, expect } from "vitest"; -import { render, screen } from "@testing-library/react"; +import { render, screen, fireEvent } from "@testing-library/react"; import { RegularSeasonStandings } from "../RegularSeasonStandings"; function makeRow(overrides: Partial<{ @@ -128,6 +128,7 @@ describe("RegularSeasonStandings", () => { userParticipantIds={NO_USER_IDS} /> ); + fireEvent.click(screen.getByRole("switch")); expect(screen.getByText("STK")).toBeInTheDocument(); }); @@ -184,7 +185,7 @@ describe("RegularSeasonStandings", () => { expect(screen.getByText("69")).toBeInTheDocument(); }); - it("renders conference headings and inline division labels when present", () => { + it("renders conference headings when standings have conference data", () => { render( { // Conference group headings are rendered as

expect(screen.getByText(/Eastern Conference/i)).toBeInTheDocument(); expect(screen.getByText(/Western Conference/i)).toBeInTheDocument(); - // Division is now shown as an inline label per row (not a section header) - expect(screen.getAllByText(/Atlantic/i).length).toBeGreaterThan(0); - expect(screen.getAllByText(/Pacific/i).length).toBeGreaterThan(0); }); it("shows ownership badge for drafted teams", () => { @@ -213,7 +211,8 @@ describe("RegularSeasonStandings", () => { userParticipantIds={NO_USER_IDS} /> ); - expect(screen.getByText("Alice")).toBeInTheDocument(); + // Owner name appears in both the mobile inline badge and the desktop Mgr column + expect(screen.getAllByText("Alice").length).toBeGreaterThan(0); }); it("does not show badge for undrafted teams", () => { @@ -249,6 +248,7 @@ describe("RegularSeasonStandings", () => { userParticipantIds={NO_USER_IDS} /> ); + fireEvent.click(screen.getByRole("switch")); const streakEl = screen.getByText("W5"); expect(streakEl.className).toContain("emerald"); }); @@ -261,6 +261,7 @@ describe("RegularSeasonStandings", () => { userParticipantIds={NO_USER_IDS} /> ); + fireEvent.click(screen.getByRole("switch")); const streakEl = screen.getByText("L3"); expect(streakEl.className).toContain("destructive"); });