import { describe, it, expect } from "vitest";
import { getSimulatorConfig, supportsProjectedWins } from "../simulator-config";

describe("simulator-config", () => {
  describe("getSimulatorConfig", () => {
    it("returns config for afl_bracket", () => {
      const config = getSimulatorConfig("afl_bracket");
      expect(config).not.toBeNull();
      expect(config?.seasonGames).toBe(23);
      expect(config?.parityFactor).toBe(450);
      expect(config?.averageOpponentElo).toBe(1500);
    });

    it("returns config for nfl_bracket", () => {
      const config = getSimulatorConfig("nfl_bracket");
      expect(config).not.toBeNull();
      expect(config?.seasonGames).toBe(17);
      expect(config?.parityFactor).toBe(400);
    });

    it("returns config for nba_bracket", () => {
      const config = getSimulatorConfig("nba_bracket");
      expect(config).not.toBeNull();
      expect(config?.seasonGames).toBe(82);
    });

    it("returns config for nhl_bracket", () => {
      const config = getSimulatorConfig("nhl_bracket");
      expect(config).not.toBeNull();
      expect(config?.seasonGames).toBe(82);
      expect(config?.parityFactor).toBe(1000);
    });

    it("returns config for mlb_bracket", () => {
      const config = getSimulatorConfig("mlb_bracket");
      expect(config).not.toBeNull();
      expect(config?.seasonGames).toBe(162);
    });

    it("returns null for snooker_bracket", () => {
      expect(getSimulatorConfig("snooker_bracket")).toBeNull();
    });

    it("returns null for darts_bracket", () => {
      expect(getSimulatorConfig("darts_bracket")).toBeNull();
    });

    it("returns null for college_hockey_bracket", () => {
      expect(getSimulatorConfig("college_hockey_bracket")).toBeNull();
    });

    it("returns null for playoff_bracket", () => {
      expect(getSimulatorConfig("playoff_bracket")).toBeNull();
    });
  });

  describe("supportsProjectedWins", () => {
    it("returns true for afl_bracket", () => {
      expect(supportsProjectedWins("afl_bracket")).toBe(true);
    });

    it("returns true for nfl_bracket", () => {
      expect(supportsProjectedWins("nfl_bracket")).toBe(true);
    });

    it("returns false for snooker_bracket", () => {
      expect(supportsProjectedWins("snooker_bracket")).toBe(false);
    });

    it("returns false for darts_bracket", () => {
      expect(supportsProjectedWins("darts_bracket")).toBe(false);
    });

    it("returns false for college_hockey_bracket", () => {
      expect(supportsProjectedWins("college_hockey_bracket")).toBe(false);
    });
  });
});
