Add airline config for B.4 action buttons
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
export interface AirlineConfig {
|
||||
name: string;
|
||||
registrationUrl?: string;
|
||||
hasNativeStatus: boolean;
|
||||
statusUrl?: string;
|
||||
}
|
||||
|
||||
export const AIRLINES: Record<string, AirlineConfig> = {
|
||||
SU: {
|
||||
name: "Aeroflot",
|
||||
registrationUrl: "https://www.aeroflot.ru/sb/ckin/app/ru-ru",
|
||||
hasNativeStatus: true,
|
||||
},
|
||||
FV: {
|
||||
name: "Rossiya",
|
||||
registrationUrl:
|
||||
"https://www.rossiya-airlines.com/flight-with-us/before_flight/the_ways_of_check-in/",
|
||||
hasNativeStatus: true,
|
||||
},
|
||||
HZ: {
|
||||
name: "Aurora",
|
||||
registrationUrl: "https://www.flyaurora.ru",
|
||||
hasNativeStatus: false,
|
||||
statusUrl: "https://www.flyaurora.ru",
|
||||
},
|
||||
DP: {
|
||||
name: "Pobeda",
|
||||
registrationUrl: "https://www.pobeda.aero",
|
||||
hasNativeStatus: false,
|
||||
statusUrl: "https://www.pobeda.aero",
|
||||
},
|
||||
AF: {
|
||||
name: "AirFrance",
|
||||
hasNativeStatus: false,
|
||||
},
|
||||
};
|
||||
|
||||
export const AIRLINES_WITH_STATUS = new Set(["SU", "HZ", "FV", "DP"]);
|
||||
Reference in New Issue
Block a user