@@ -13,7 +13,6 @@ import {
1313 getPathWithLocale ,
1414 rebuildPathWithParams ,
1515 removeQueryParamsFromPath ,
16- absoluteUrl ,
1716 createUrlTemplate ,
1817 removeSiteLocaleFromPath ,
1918 serverSafeEncode
@@ -394,36 +393,6 @@ describe('removeQueryParamsFromPath test', () => {
394393 } )
395394} )
396395
397- describe ( 'absoluteUrl' , function ( ) {
398- test ( 'return undefined when path is not provided' , ( ) => {
399- const url = absoluteUrl ( )
400- expect ( url ) . toBeUndefined ( )
401- } )
402-
403- test ( 'return expected when path is a relative url' , ( ) => {
404- const url = absoluteUrl ( '/uk/en/women/dresses' )
405- expect ( url ) . toBe ( 'https://www.example.com/uk/en/women/dresses' )
406- } )
407-
408- test ( 'return expected when path is an absolute url' , ( ) => {
409- const url = absoluteUrl ( 'https://www.example.com/uk/en/women/dresses' )
410- expect ( url ) . toBe ( 'https://www.example.com/uk/en/women/dresses' )
411- } )
412-
413- test ( 'return expected when path is a relative url and appOrigin is provided' , ( ) => {
414- const url = absoluteUrl ( 'uk/en/women/dresses' , 'https://www.custom.com' )
415- expect ( url ) . toBe ( 'https://www.custom.com/uk/en/women/dresses' )
416- } )
417-
418- test ( 'return expected when path is an absolute url and appOrigin is provided' , ( ) => {
419- const url = absoluteUrl (
420- 'https://www.example.com/uk/en/women/dresses' ,
421- 'https://www.should-be-ignored.com'
422- )
423- expect ( url ) . toBe ( 'https://www.example.com/uk/en/women/dresses' )
424- } )
425- } )
426-
427396describe ( 'removeSiteLocaleFromPath' , function ( ) {
428397 test ( 'return path without site alias and locale' , ( ) => {
429398 const pathName = removeSiteLocaleFromPath ( '/uk/en-GB/account/wishlist' )
0 commit comments