import { describe, expect, it } from "vitest"; import { getRegionFlag } from "./region-flags"; // --------------------------------------------------------------------------- // Fix 6: Taiwan (asia-east1) mapped correctly vs Hong Kong (asia-east2) // --------------------------------------------------------------------------- describe("getRegionFlag β€” Taiwan vs Hong Kong disambiguation", () => { it("should return πŸ‡ΉπŸ‡Ό for GCP asia-east1 (Taiwan)", () => { // Given/When const result = getRegionFlag("asia-east1"); // Then expect(result).toBe("πŸ‡ΉπŸ‡Ό"); }); it("should return πŸ‡­πŸ‡° for GCP asia-east2 (Hong Kong)", () => { // Given/When const result = getRegionFlag("asia-east2"); // Then expect(result).toBe("πŸ‡­πŸ‡°"); }); it("should return πŸ‡­πŸ‡° for regions containing 'hongkong'", () => { // Given/When const result = getRegionFlag("hongkong"); // Then expect(result).toBe("πŸ‡­πŸ‡°"); }); it("should NOT return πŸ‡­πŸ‡° for asia-east1", () => { // Given/When const result = getRegionFlag("asia-east1"); // Then β€” confirm it's not Hong Kong flag expect(result).not.toBe("πŸ‡­πŸ‡°"); }); }); describe("getRegionFlag β€” existing regions not broken", () => { it("should return πŸ‡ΊπŸ‡Έ for us-east-1 (AWS)", () => { expect(getRegionFlag("us-east-1")).toBe("πŸ‡ΊπŸ‡Έ"); }); it("should return πŸ‡ͺπŸ‡Ί for eu-west-1 (AWS)", () => { expect(getRegionFlag("eu-west-1")).toBe("πŸ‡ͺπŸ‡Ί"); }); it("should return πŸ‡―πŸ‡΅ for ap-northeast-1 (Japan)", () => { expect(getRegionFlag("ap-northeast-1")).toBe("πŸ‡―πŸ‡΅"); }); it("should return πŸ‡¦πŸ‡Ί for ap-southeast-2 (Australia)", () => { expect(getRegionFlag("ap-southeast-2")).toBe("πŸ‡¦πŸ‡Ί"); }); it("should return πŸ‡ΈπŸ‡¬ for ap-southeast-1 (Singapore)", () => { expect(getRegionFlag("ap-southeast-1")).toBe("πŸ‡ΈπŸ‡¬"); }); it("should return empty string for '-' (unknown/no region)", () => { expect(getRegionFlag("-")).toBe(""); }); it("should return empty string for empty string", () => { expect(getRegionFlag("")).toBe(""); }); });