@@ -6,8 +6,8 @@ describe('sanitizeUrl', () => {
66 const testCases = [
77 { input : 'http://example.com' , expected : 'http://example.com/' } ,
88 { input : 'https://www.google.com' , expected : 'https://www.google.com/' } ,
9- { input : 'http://test.com/path/to/resource' , expected : 'http://test.com/path%2Fto%2Fresource ' } ,
10- { input : 'https://api.github.com/users/octocat' , expected : 'https://api.github.com/users%2Foctocat ' } ,
9+ { input : 'http://test.com/path/to/resource' , expected : 'http://test.com/path/to/resource ' } ,
10+ { input : 'https://api.github.com/users/octocat' , expected : 'https://api.github.com/users/octocat ' } ,
1111 {
1212 input : 'https://subdomain.example.com/page?param=value#section' ,
1313 expected : 'https://subdomain.example.com/page?param=value#section' ,
@@ -77,13 +77,13 @@ describe('sanitizeUrl', () => {
7777 it ( 'should handle URL with all components' , ( ) => {
7878 const complexUrl = 'https://user:pass@example.com:8080/path/to/resource?param=value&other=test#fragment'
7979 const result = sanitizeUrl ( complexUrl )
80- expect ( result ) . toBe ( 'https://user:pass@example.com:8080/path%2Fto%2Fresource ?param=value&other=test#fragment' )
80+ expect ( result ) . toBe ( 'https://user:pass@example.com:8080/path/to/resource ?param=value&other=test#fragment' )
8181 } )
8282
8383 it ( 'should preserve valid URL structure' , ( ) => {
8484 const url = 'https://api.example.com/v1/users?limit=10&offset=0#results'
8585 const result = sanitizeUrl ( url )
86- expect ( result ) . toBe ( 'https://api.example.com/v1%2Fusers ?limit=10&offset=0#results' )
86+ expect ( result ) . toBe ( 'https://api.example.com/v1/users ?limit=10&offset=0#results' )
8787 } )
8888 } )
8989
0 commit comments