@@ -18,7 +18,6 @@ import {
1818 MOCK_CMS_INFO_SPLIT_LAYOUT_BG ,
1919} from './mocks' ;
2020import { MOCK_CMS_INFO } from '../../pages/mocks' ;
21- import { useDynamicLocalization } from '../../contexts/DynamicLocalizationContext' ;
2221
2322// Mock the useConfig hook
2423jest . mock ( '../../models/hooks' , ( ) => ( {
@@ -32,17 +31,6 @@ jest.mock('../../models/hooks', () => ({
3231 } ) ,
3332} ) ) ;
3433
35- jest . mock ( '../../contexts/DynamicLocalizationContext' , ( ) => ( {
36- useDynamicLocalization : jest . fn ( ( ) => ( {
37- currentLocale : 'en' ,
38- switchLanguage : jest . fn ( ) ,
39- clearLanguagePreference : jest . fn ( ) ,
40- isLoading : false ,
41- } ) ) ,
42- } ) ) ;
43-
44- const mockUseDynamicLocalization = useDynamicLocalization as jest . Mock ;
45-
4634describe ( '<AppLayout />' , ( ) => {
4735 it ( 'renders as expected with children' , async ( ) => {
4836 renderWithLocalizationProvider (
@@ -393,15 +381,8 @@ describe('<AppLayout />', () => {
393381 } ) ;
394382 } ) ;
395383
396- describe ( 'splitLayout with locale restrictions (temp hack)' , ( ) => {
397- it ( 'renders split layout when splitLayout is true and locale is English' , ( ) => {
398- mockUseDynamicLocalization . mockReturnValue ( {
399- currentLocale : 'en-US' ,
400- switchLanguage : jest . fn ( ) ,
401- clearLanguagePreference : jest . fn ( ) ,
402- isLoading : false ,
403- } ) ;
404-
384+ describe ( 'splitLayout' , ( ) => {
385+ it ( 'renders split layout when splitLayout is true' , ( ) => {
405386 renderWithLocalizationProvider (
406387 < AppLayout splitLayout = { true } cmsInfo = { MOCK_CMS_INFO_SPLIT_LAYOUT_BG } >
407388 < p > Split layout content</ p >
@@ -417,31 +398,5 @@ describe('<AppLayout />', () => {
417398
418399 screen . getByText ( 'Split layout content' ) ;
419400 } ) ;
420-
421- it ( 'renders default layout when splitLayout is true but locale is not English' , ( ) => {
422- mockUseDynamicLocalization . mockReturnValue ( {
423- currentLocale : 'fr' ,
424- switchLanguage : jest . fn ( ) ,
425- clearLanguagePreference : jest . fn ( ) ,
426- isLoading : false ,
427- } ) ;
428-
429- renderWithLocalizationProvider (
430- < AppLayout splitLayout = { true } cmsInfo = { MOCK_CMS_INFO_HEADER_LOGO } >
431- < p > Default layout content</ p >
432- </ AppLayout >
433- ) ;
434-
435- expect (
436- screen . queryByRole ( 'img' , {
437- name : MOCK_CMS_INFO_SPLIT_LAYOUT_BG . shared . backgrounds
438- ?. splitLayoutAltText as string ,
439- } )
440- ) . not . toBeInTheDocument ( ) ;
441-
442- screen . getByText ( 'Default layout content' ) ;
443- // CMS info is still applied even when split layout is disabled
444- expect ( screen . getByAltText ( 'CMS Custom Logo' ) ) . toBeInTheDocument ( ) ;
445- } ) ;
446401 } ) ;
447402} ) ;
0 commit comments