22 lines
742 B
TypeScript
22 lines
742 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { filterVisibleSportsSeasons } from "../admin.sports-seasons.helpers";
|
|
|
|
describe("filterVisibleSportsSeasons", () => {
|
|
const sportsSeasons = [
|
|
{ id: "season-1", status: "upcoming" },
|
|
{ id: "season-2", status: "active" },
|
|
{ id: "season-3", status: "completed" },
|
|
];
|
|
|
|
it("hides completed seasons when the filter is enabled", () => {
|
|
expect(filterVisibleSportsSeasons(sportsSeasons, true)).toEqual([
|
|
{ id: "season-1", status: "upcoming" },
|
|
{ id: "season-2", status: "active" },
|
|
]);
|
|
});
|
|
|
|
it("shows completed seasons when the filter is disabled", () => {
|
|
expect(filterVisibleSportsSeasons(sportsSeasons, false)).toEqual(sportsSeasons);
|
|
});
|
|
});
|