@@ -98,18 +98,28 @@ describe("getBranchDashboardUrl", () => {
9898} ) ;
9999
100100describe ( "getLocalDashboardUrl" , ( ) => {
101- it ( "generates local dashboard URL with default port " , ( ) => {
102- const result = getLocalDashboardUrl ( "my_local_workspace" ) ;
103- expect ( result ) . toBe ( "https://cloud.tinybird.co/local/7181/ my_local_workspace" ) ;
101+ it ( "generates local dashboard URL with region info " , ( ) => {
102+ const result = getLocalDashboardUrl ( "https://api.tinybird.co" , "my_cloud_workspace" , " my_local_workspace") ;
103+ expect ( result ) . toBe ( "https://cloud.tinybird.co/gcp/europe-west3/my_cloud_workspace~local~ my_local_workspace" ) ;
104104 } ) ;
105105
106- it ( "generates local dashboard URL with custom port" , ( ) => {
107- const result = getLocalDashboardUrl ( "my_local_workspace" , 8080 ) ;
108- expect ( result ) . toBe ( "https://cloud.tinybird.co/local/8080/my_local_workspace" ) ;
106+ it ( "generates local dashboard URL for US East GCP" , ( ) => {
107+ const result = getLocalDashboardUrl ( "https://api.us-east.tinybird.co" , "my_cloud_workspace" , "feature_branch" ) ;
108+ expect ( result ) . toBe ( "https://cloud.tinybird.co/gcp/us-east4/my_cloud_workspace~local~feature_branch" ) ;
109+ } ) ;
110+
111+ it ( "generates local dashboard URL for AWS" , ( ) => {
112+ const result = getLocalDashboardUrl ( "https://api.us-west-2.aws.tinybird.co" , "my_cloud_workspace" , "feature_branch" ) ;
113+ expect ( result ) . toBe ( "https://cloud.tinybird.co/aws/us-west-2/my_cloud_workspace~local~feature_branch" ) ;
114+ } ) ;
115+
116+ it ( "returns null for unknown regions" , ( ) => {
117+ const result = getLocalDashboardUrl ( "https://api.unknown.tinybird.co" , "my_cloud_workspace" , "feature_branch" ) ;
118+ expect ( result ) . toBeNull ( ) ;
109119 } ) ;
110120
111121 it ( "handles workspace names with underscores" , ( ) => {
112- const result = getLocalDashboardUrl ( "dublin_feature_branch" ) ;
113- expect ( result ) . toBe ( "https://cloud.tinybird.co/local/7181/ dublin_feature_branch" ) ;
122+ const result = getLocalDashboardUrl ( "https://api.tinybird.co" , "tssdkgnzinit" , " dublin_feature_branch") ;
123+ expect ( result ) . toBe ( "https://cloud.tinybird.co/gcp/europe-west3/tssdkgnzinit~local~ dublin_feature_branch" ) ;
114124 } ) ;
115125} ) ;
0 commit comments