@@ -1196,7 +1196,7 @@ describe('validateAirtableId', () => {
11961196} )
11971197
11981198describe ( 'validateAwsRegion' , ( ) => {
1199- describe ( 'valid regions' , ( ) => {
1199+ describe ( 'valid standard regions' , ( ) => {
12001200 it . concurrent ( 'should accept us-east-1' , ( ) => {
12011201 const result = validateAwsRegion ( 'us-east-1' )
12021202 expect ( result . isValid ) . toBe ( true )
@@ -1213,11 +1213,21 @@ describe('validateAwsRegion', () => {
12131213 expect ( result . isValid ) . toBe ( true )
12141214 } )
12151215
1216+ it . concurrent ( 'should accept eu-central-1' , ( ) => {
1217+ const result = validateAwsRegion ( 'eu-central-1' )
1218+ expect ( result . isValid ) . toBe ( true )
1219+ } )
1220+
12161221 it . concurrent ( 'should accept ap-southeast-1' , ( ) => {
12171222 const result = validateAwsRegion ( 'ap-southeast-1' )
12181223 expect ( result . isValid ) . toBe ( true )
12191224 } )
12201225
1226+ it . concurrent ( 'should accept ap-northeast-1' , ( ) => {
1227+ const result = validateAwsRegion ( 'ap-northeast-1' )
1228+ expect ( result . isValid ) . toBe ( true )
1229+ } )
1230+
12211231 it . concurrent ( 'should accept sa-east-1' , ( ) => {
12221232 const result = validateAwsRegion ( 'sa-east-1' )
12231233 expect ( result . isValid ) . toBe ( true )
@@ -1233,12 +1243,58 @@ describe('validateAwsRegion', () => {
12331243 expect ( result . isValid ) . toBe ( true )
12341244 } )
12351245
1246+ it . concurrent ( 'should accept ca-central-1' , ( ) => {
1247+ const result = validateAwsRegion ( 'ca-central-1' )
1248+ expect ( result . isValid ) . toBe ( true )
1249+ } )
1250+
1251+ it . concurrent ( 'should accept il-central-1' , ( ) => {
1252+ const result = validateAwsRegion ( 'il-central-1' )
1253+ expect ( result . isValid ) . toBe ( true )
1254+ } )
1255+
12361256 it . concurrent ( 'should accept regions with double-digit numbers' , ( ) => {
12371257 const result = validateAwsRegion ( 'ap-northeast-12' )
12381258 expect ( result . isValid ) . toBe ( true )
12391259 } )
12401260 } )
12411261
1262+ describe ( 'valid GovCloud regions' , ( ) => {
1263+ it . concurrent ( 'should accept us-gov-west-1' , ( ) => {
1264+ const result = validateAwsRegion ( 'us-gov-west-1' )
1265+ expect ( result . isValid ) . toBe ( true )
1266+ } )
1267+
1268+ it . concurrent ( 'should accept us-gov-east-1' , ( ) => {
1269+ const result = validateAwsRegion ( 'us-gov-east-1' )
1270+ expect ( result . isValid ) . toBe ( true )
1271+ } )
1272+ } )
1273+
1274+ describe ( 'valid China regions' , ( ) => {
1275+ it . concurrent ( 'should accept cn-north-1' , ( ) => {
1276+ const result = validateAwsRegion ( 'cn-north-1' )
1277+ expect ( result . isValid ) . toBe ( true )
1278+ } )
1279+
1280+ it . concurrent ( 'should accept cn-northwest-1' , ( ) => {
1281+ const result = validateAwsRegion ( 'cn-northwest-1' )
1282+ expect ( result . isValid ) . toBe ( true )
1283+ } )
1284+ } )
1285+
1286+ describe ( 'valid ISO regions' , ( ) => {
1287+ it . concurrent ( 'should accept us-iso-east-1' , ( ) => {
1288+ const result = validateAwsRegion ( 'us-iso-east-1' )
1289+ expect ( result . isValid ) . toBe ( true )
1290+ } )
1291+
1292+ it . concurrent ( 'should accept us-isob-east-1' , ( ) => {
1293+ const result = validateAwsRegion ( 'us-isob-east-1' )
1294+ expect ( result . isValid ) . toBe ( true )
1295+ } )
1296+ } )
1297+
12421298 describe ( 'invalid regions' , ( ) => {
12431299 it . concurrent ( 'should reject null' , ( ) => {
12441300 const result = validateAwsRegion ( null )
@@ -1282,6 +1338,16 @@ describe('validateAwsRegion', () => {
12821338 expect ( result . isValid ) . toBe ( false )
12831339 } )
12841340
1341+ it . concurrent ( 'should reject invalid prefix' , ( ) => {
1342+ const result = validateAwsRegion ( 'xx-east-1' )
1343+ expect ( result . isValid ) . toBe ( false )
1344+ } )
1345+
1346+ it . concurrent ( 'should reject invalid direction' , ( ) => {
1347+ const result = validateAwsRegion ( 'us-middle-1' )
1348+ expect ( result . isValid ) . toBe ( false )
1349+ } )
1350+
12851351 it . concurrent ( 'should use custom param name in errors' , ( ) => {
12861352 const result = validateAwsRegion ( '' , 'awsRegion' )
12871353 expect ( result . error ) . toContain ( 'awsRegion' )
0 commit comments