import { describe, it, expect } from "vitest";
import { AIRLINES, AIRLINES_WITH_STATUS } from "./airlines.js";

describe("AIRLINES", () => {
  it("has SU Aeroflot with registration URL and native status", () => {
    const su = AIRLINES.SU;
    expect(su).toBeDefined();
    expect(su?.name).toBe("Aeroflot");
    expect(su?.registrationUrl).toContain("aeroflot.ru");
    expect(su?.hasNativeStatus).toBe(true);
  });

  it("has HZ Aurora with external status URL", () => {
    const hz = AIRLINES.HZ;
    expect(hz?.hasNativeStatus).toBe(false);
    expect(hz?.statusUrl).toContain("flyaurora");
  });

  it("has AF AirFrance with no registration URL", () => {
    const af = AIRLINES.AF;
    expect(af).toBeDefined();
    expect(af?.registrationUrl).toBeUndefined();
  });
});

describe("AIRLINES_WITH_STATUS", () => {
  it("contains SU, HZ, FV, DP", () => {
    expect(AIRLINES_WITH_STATUS.has("SU")).toBe(true);
    expect(AIRLINES_WITH_STATUS.has("HZ")).toBe(true);
    expect(AIRLINES_WITH_STATUS.has("FV")).toBe(true);
    expect(AIRLINES_WITH_STATUS.has("DP")).toBe(true);
  });

  it("does not contain AF", () => {
    expect(AIRLINES_WITH_STATUS.has("AF")).toBe(false);
  });
});
