|
| 1 | +// Tests for VERTEX_REGIONS "global" region handling |
| 2 | + |
| 3 | +import { describe, it, expect } from "vitest" |
| 4 | +import { VERTEX_REGIONS } from "../../../../../../packages/types/src/providers/vertex" |
| 5 | + |
| 6 | +describe("VERTEX_REGIONS", () => { |
| 7 | + it('should include the "global" region as the first entry', () => { |
| 8 | + expect(VERTEX_REGIONS[0]).toEqual({ value: "global", label: "global" }) |
| 9 | + }) |
| 10 | + |
| 11 | + it('should contain "global" region exactly once', () => { |
| 12 | + const globalRegions = VERTEX_REGIONS.filter((r: { value: string; label: string }) => r.value === "global") |
| 13 | + expect(globalRegions).toHaveLength(1) |
| 14 | + }) |
| 15 | + |
| 16 | + it('should contain all expected regions including "global"', () => { |
| 17 | + // The expected list is the imported VERTEX_REGIONS itself |
| 18 | + expect(VERTEX_REGIONS).toEqual([ |
| 19 | + { value: "global", label: "global" }, |
| 20 | + { value: "us-central1", label: "us-central1" }, |
| 21 | + { value: "us-east1", label: "us-east1" }, |
| 22 | + { value: "us-east4", label: "us-east4" }, |
| 23 | + { value: "us-east5", label: "us-east5" }, |
| 24 | + { value: "us-west1", label: "us-west1" }, |
| 25 | + { value: "us-west2", label: "us-west2" }, |
| 26 | + { value: "us-west3", label: "us-west3" }, |
| 27 | + { value: "us-west4", label: "us-west4" }, |
| 28 | + { value: "northamerica-northeast1", label: "northamerica-northeast1" }, |
| 29 | + { value: "northamerica-northeast2", label: "northamerica-northeast2" }, |
| 30 | + { value: "southamerica-east1", label: "southamerica-east1" }, |
| 31 | + { value: "europe-west1", label: "europe-west1" }, |
| 32 | + { value: "europe-west2", label: "europe-west2" }, |
| 33 | + { value: "europe-west3", label: "europe-west3" }, |
| 34 | + { value: "europe-west4", label: "europe-west4" }, |
| 35 | + { value: "europe-west6", label: "europe-west6" }, |
| 36 | + { value: "europe-central2", label: "europe-central2" }, |
| 37 | + { value: "asia-east1", label: "asia-east1" }, |
| 38 | + { value: "asia-east2", label: "asia-east2" }, |
| 39 | + { value: "asia-northeast1", label: "asia-northeast1" }, |
| 40 | + { value: "asia-northeast2", label: "asia-northeast2" }, |
| 41 | + { value: "asia-northeast3", label: "asia-northeast3" }, |
| 42 | + { value: "asia-south1", label: "asia-south1" }, |
| 43 | + { value: "asia-south2", label: "asia-south2" }, |
| 44 | + { value: "asia-southeast1", label: "asia-southeast1" }, |
| 45 | + { value: "asia-southeast2", label: "asia-southeast2" }, |
| 46 | + { value: "australia-southeast1", label: "australia-southeast1" }, |
| 47 | + { value: "australia-southeast2", label: "australia-southeast2" }, |
| 48 | + { value: "me-west1", label: "me-west1" }, |
| 49 | + { value: "me-central1", label: "me-central1" }, |
| 50 | + { value: "africa-south1", label: "africa-south1" }, |
| 51 | + ]) |
| 52 | + }) |
| 53 | + |
| 54 | + it('should contain "asia-east1" region exactly once', () => { |
| 55 | + const asiaEast1Regions = VERTEX_REGIONS.filter( |
| 56 | + (r: { value: string; label: string }) => r.value === "asia-east1" && r.label === "asia-east1", |
| 57 | + ) |
| 58 | + expect(asiaEast1Regions).toHaveLength(1) |
| 59 | + expect(asiaEast1Regions[0]).toEqual({ value: "asia-east1", label: "asia-east1" }) |
| 60 | + }) |
| 61 | +}) |
0 commit comments