@@ -17,34 +17,20 @@ import {
1717 removeSiteLocaleFromPath ,
1818 serverSafeEncode
1919} from '@salesforce/retail-react-app/app/utils/url'
20- import { getUrlConfig } from '@salesforce/retail-react-app/app/utils/site-utils'
2120import mockConfig from '@salesforce/retail-react-app/config/mocks/default'
2221import { getRouterBasePath } from '@salesforce/pwa-kit-react-sdk/ssr/universal/utils'
22+ import { getConfig } from '@salesforce/pwa-kit-runtime/utils/ssr-config'
2323
2424afterEach ( ( ) => {
2525 jest . clearAllMocks ( )
2626} )
2727
28- jest . mock ( '@salesforce/pwa-kit-react-sdk/utils/url' , ( ) => {
29- const original = jest . requireActual ( '@salesforce/pwa-kit-react-sdk/utils/url' )
30- return {
31- ...original ,
32- getAppOrigin : jest . fn ( ( ) => 'https://www.example.com' )
28+ jest . mock ( '@salesforce/pwa-kit-runtime/utils/ssr-config' , ( ) => ( {
29+ getConfig : jest . fn ( )
30+ } ) )
3331
34- jest . mock ( './utils' , ( ) => {
35- const original = jest . requireActual ( './utils' )
36- return {
37- ...original ,
38- getConfig : jest . fn ( ( ) => mockConfig )
39- }
40- } )
41-
42- jest . mock ( './site-utils' , ( ) => {
43- const original = jest . requireActual ( './site-utils' )
44- return {
45- ...original ,
46- getUrlConfig : jest . fn ( )
47- }
32+ beforeEach ( ( ) => {
33+ getConfig . mockReturnValue ( mockConfig )
4834} )
4935jest . mock ( '@salesforce/pwa-kit-runtime/utils/ssr-namespace-paths' , ( ) => {
5036 const original = jest . requireActual ( '@salesforce/pwa-kit-runtime/utils/ssr-namespace-paths' )
@@ -153,8 +139,6 @@ describe('url builder test', () => {
153139} )
154140
155141describe ( 'getPathWithLocale' , ( ) => {
156- getUrlConfig . mockImplementation ( ( ) => mockConfig . app . url )
157-
158142 test ( 'getPathWithLocale returns expected for PLP' , ( ) => {
159143 const location = new URL ( 'http://localhost:3000/uk/it-IT/category/newarrivals-womens' )
160144 const buildUrl = createUrlTemplate ( mockConfig . app , 'uk' , 'it-IT' )
0 commit comments