@@ -3,7 +3,7 @@ import esmock from "esmock";
33import sinonGlobal from "sinon" ;
44import { InvalidInputError } from "../../../../src/utils.js" ;
55import path from "node:path" ;
6- import { isValidUrl as realIsValidUrl , getAllowedOdataV4Domains } from "../../../../src/utils/URLHelper.js" ;
6+ import { isValidUrl as realIsValidUrl , getAllowedDomains } from "../../../../src/utils/URLHelper.js" ;
77
88// Define test context type
99const test = anyTest as TestFn < {
@@ -93,7 +93,7 @@ test.beforeEach(async (t) => {
9393 } ,
9494 "../../../../src/utils/URLHelper.js" : {
9595 isValidUrl : t . context . isValidUrlStub ,
96- getAllowedOdataV4Domains ,
96+ getAllowedDomains ,
9797 } ,
9898 }
9999 ) ;
@@ -243,10 +243,9 @@ test.serial("Destinations: Throws error when there is not allowed domain", async
243243 defaultUrl : "https://invalid-domain.com/api/v1/" ,
244244 } ,
245245 ] ;
246- const currentAllowedDomains = process . env . UI5_MCP_SERVER_ALLOWED_ODATA_DOMAINS ;
247246 const allowedDomains = [ "allowed-domain.com" ] ;
248247
249- process . env . UI5_MCP_SERVER_ALLOWED_ODATA_DOMAINS = "allowed-domain.com" ;
248+ process . env . UI5_MCP_SERVER_ALLOWED_DOMAINS = "allowed-domain.com" ;
250249
251250 await t . throwsAsync ( async ( ) => {
252251 await createIntegrationCard ( {
@@ -270,9 +269,6 @@ test.serial("Destinations: Throws error when there is not allowed domain", async
270269 [ destinations [ 0 ] . defaultUrl , allowedDomains ] ,
271270 "isValidUrl should be called with the destination URL and allowed domains"
272271 ) ;
273-
274- // Restore original allowed domains after test
275- process . env . UI5_MCP_SERVER_ALLOWED_ODATA_DOMAINS = currentAllowedDomains ;
276272} ) ;
277273
278274test . serial ( "Destinations: Successfully generates card template with allowed destination domain" , async ( t ) => {
@@ -284,8 +280,7 @@ test.serial("Destinations: Successfully generates card template with allowed des
284280 defaultUrl : "https://allowed-domain.com/api/v1/" ,
285281 } ,
286282 ] ;
287- const currentAllowedDomains = process . env . UI5_MCP_SERVER_ALLOWED_ODATA_DOMAINS ;
288- process . env . UI5_MCP_SERVER_ALLOWED_ODATA_DOMAINS = "allowed-domain.com" ;
283+ process . env . UI5_MCP_SERVER_ALLOWED_DOMAINS = "allowed-domain.com" ;
289284
290285 await t . notThrowsAsync ( async ( ) => {
291286 await createIntegrationCard ( {
@@ -303,7 +298,4 @@ test.serial("Destinations: Successfully generates card template with allowed des
303298 [ destinations [ 0 ] . defaultUrl , [ "allowed-domain.com" ] ] ,
304299 "isValidUrl should be called with the destination URL and allowed domains"
305300 ) ;
306-
307- // Restore original allowed domains after test
308- process . env . UI5_MCP_SERVER_ALLOWED_ODATA_DOMAINS = currentAllowedDomains ;
309301} ) ;
0 commit comments