File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -339,20 +339,24 @@ describe('util/url', () => {
339339 ) . toBe ( 'https://dev.azure.com/my%20org/my%20project/_git/my%20repo/' ) ;
340340 } ) ;
341341
342- it ( 'leaves the origin untouched ' , ( ) => {
342+ it ( 'drops the default https port and encodes path segments ' , ( ) => {
343343 const origin = 'https://dev.azure.com:443/' ;
344344 const encoded = encodeUrlPathSegments (
345345 `${ origin } my org/my project/_git/my repo` ,
346346 ) ;
347- expect ( encoded . startsWith ( 'https://dev.azure.com/' ) ) . toBe ( true ) ;
347+ expect ( encoded ) . toBe (
348+ 'https://dev.azure.com/my%20org/my%20project/_git/my%20repo' ,
349+ ) ;
348350 } ) ;
349351
350- it ( 'preserves non-default ports' , ( ) => {
352+ it ( 'preserves non-default ports and encodes path segments ' , ( ) => {
351353 const origin = 'https://azure-devops.interal.corp:8080/tfs/' ;
352354 const encoded = encodeUrlPathSegments (
353355 `${ origin } my org/my project/_git/my repo` ,
354356 ) ;
355- expect ( encoded . startsWith ( origin ) ) . toBe ( true ) ;
357+ expect ( encoded ) . toBe (
358+ 'https://azure-devops.interal.corp:8080/tfs/my%20org/my%20project/_git/my%20repo' ,
359+ ) ;
356360 } ) ;
357361
358362 it ( 'leaves a plain URL with no special characters unchanged (regression baseline)' , ( ) => {
You can’t perform that action at this time.
0 commit comments