@@ -22,10 +22,8 @@ describe("HttpLocalizer", () => {
2222 ) ;
2323
2424 jest . spyOn ( httpLocalizer , "getLocale" ) . mockReturnValue ( "en-US" ) ;
25- await httpLocalizer . loadTranslations ( ) ;
26- expect ( fetchMock ) . toHaveBeenCalledWith (
27- "/resources/i18n/resources.en.json"
28- ) ;
25+ await httpLocalizer . loadTranslations ( "/base/url" ) ;
26+ expect ( fetchMock ) . toHaveBeenCalledWith ( "/base/url/resources.en.json" ) ;
2927 expect ( httpLocalizer . translate ( "hello" ) ) . toEqual ( "world" ) ;
3028 } ) ;
3129
@@ -39,7 +37,7 @@ describe("HttpLocalizer", () => {
3937
4038 // Simulate a French locale
4139 jest . spyOn ( httpLocalizer , "getLocale" ) . mockReturnValue ( "fr-FR" ) ;
42- await httpLocalizer . loadTranslations ( ) ;
40+ await httpLocalizer . loadTranslations ( "/resources/i18n" ) ;
4341 expect ( fetchMock ) . toHaveBeenCalledWith (
4442 "/resources/i18n/resources.fr.json"
4543 ) ;
@@ -56,7 +54,7 @@ describe("HttpLocalizer", () => {
5654
5755 // Simulate an invalid locale
5856 jest . spyOn ( httpLocalizer , "getLocale" ) . mockReturnValue ( "abc" ) ;
59- await httpLocalizer . loadTranslations ( ) ;
57+ await httpLocalizer . loadTranslations ( "/resources/i18n" ) ;
6058 expect ( fetchMock ) . toHaveBeenCalledWith (
6159 "/resources/i18n/resources.en.json"
6260 ) ;
@@ -78,7 +76,7 @@ describe("HttpLocalizer", () => {
7876 ) ;
7977
8078 jest . spyOn ( httpLocalizer , "getLocale" ) . mockReturnValue ( "en-US" ) ;
81- await httpLocalizer . loadTranslations ( ) ;
79+ await httpLocalizer . loadTranslations ( "/resources/i18n" ) ;
8280 expect ( httpLocalizer . translate ( "notFound" ) ) . toEqual ( "notFound" ) ;
8381 } ) ;
8482} ) ;
0 commit comments