import { describe, it, expect, beforeAll } from "vitest";
import allGamesConfig from "./services/all-games-config.json.ts";

describe("Easter Eggsplosion Game Integration", () => {
  let easterGame: any;

  beforeAll(() => {
    // Find Easter game in config
    easterGame = allGamesConfig.games.find(
      (g: any) => g.id === "easter-eggsplosion"
    );
  });

  it("should have Easter Eggsplosion in config", () => {
    expect(easterGame).toBeDefined();
    expect(easterGame.id).toBe("easter-eggsplosion");
    expect(easterGame.name).toBe("Easter Eggsplosion");
  });

  it("should have correct provider", () => {
    expect(easterGame.provider).toBe("CoinKrazy Original");
  });

  it("should be a slot game", () => {
    expect(easterGame.type).toBe("slot");
    expect(easterGame.category).toBe("slots");
  });

  it("should have correct RTP", () => {
    expect(easterGame.rtp).toBe(96.5);
  });

  it("should have medium volatility", () => {
    expect(easterGame.volatility).toBe("medium");
  });

  it("should have 5 paylines", () => {
    expect(easterGame.paylines).toBe(5);
  });

  it("should have 3 reels", () => {
    expect(easterGame.reels).toBe(3);
  });

  it("should have correct bet range", () => {
    expect(easterGame.minBet).toBe(0.1);
    expect(easterGame.maxBet).toBe(100.0);
  });

  it("should be active and featured", () => {
    expect(easterGame.isActive).toBe(true);
    expect(easterGame.isFeatured).toBe(true);
  });

  it("should have icon", () => {
    expect(easterGame.hasIcon).toBe(true);
  });

  it("should have initial stats", () => {
    expect(easterGame.playCount).toBe(0);
    expect(easterGame.totalWinnings).toBe(0);
    expect(easterGame.averageWin).toBe(0);
  });

  it("should be in the games array", () => {
    expect(allGamesConfig.games.length).toBeGreaterThan(0);
    expect(allGamesConfig.games.some((g: any) => g.id === "easter-eggsplosion")).toBe(
      true
    );
  });
});
