@@ -2331,6 +2331,10 @@ describe('<CourseUnit />', () => {
23312331 const newUnitId = '12345' ;
23322332
23332333 beforeEach ( async ( ) => {
2334+ setConfig ( {
2335+ ...getConfig ( ) ,
2336+ ENABLE_UNIT_PAGE_NEW_DESIGN : 'false' ,
2337+ } ) ;
23342338 axiosMock
23352339 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
23362340 . reply ( 200 , {
@@ -2524,6 +2528,7 @@ describe('<CourseUnit />', () => {
25242528 setConfig ( {
25252529 ...getConfig ( ) ,
25262530 ENABLE_TAGGING_TAXONOMY_PAGES : 'true' ,
2531+ ENABLE_UNIT_PAGE_NEW_DESIGN : 'false' ,
25272532 } ) ;
25282533 render ( < RootWrapper /> ) ;
25292534
@@ -2567,10 +2572,6 @@ describe('<CourseUnit />', () => {
25672572 } ) ;
25682573
25692574 it ( 'renders new unit info/settings sidebar' , async ( ) => {
2570- setConfig ( {
2571- ...getConfig ( ) ,
2572- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2573- } ) ;
25742575 const user = userEvent . setup ( ) ;
25752576 render ( < RootWrapper /> ) ;
25762577
@@ -2595,10 +2596,6 @@ describe('<CourseUnit />', () => {
25952596 } ) ;
25962597
25972598 it ( 'displays the live state in the status bar' , async ( ) => {
2598- setConfig ( {
2599- ...getConfig ( ) ,
2600- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2601- } ) ;
26022599 axiosMock
26032600 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
26042601 . reply ( 200 , {
@@ -2614,10 +2611,6 @@ describe('<CourseUnit />', () => {
26142611 } ) ;
26152612
26162613 it ( 'should change the visibility of the unit in the settings sidebar' , async ( ) => {
2617- setConfig ( {
2618- ...getConfig ( ) ,
2619- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2620- } ) ;
26212614 const user = userEvent . setup ( ) ;
26222615 render ( < RootWrapper /> ) ;
26232616
@@ -2691,11 +2684,6 @@ describe('<CourseUnit />', () => {
26912684 } ) ;
26922685
26932686 it ( 'displays the staff only state in the status bar' , async ( ) => {
2694- setConfig ( {
2695- ...getConfig ( ) ,
2696- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2697- } ) ;
2698-
26992687 axiosMock
27002688 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
27012689 . reply ( 200 , {
@@ -2715,10 +2703,6 @@ describe('<CourseUnit />', () => {
27152703
27162704 it ( 'should disable discussions in the settings sidebar' , async ( ) => {
27172705 const user = userEvent . setup ( ) ;
2718- setConfig ( {
2719- ...getConfig ( ) ,
2720- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2721- } ) ;
27222706 render ( < RootWrapper /> ) ;
27232707
27242708 axiosMock
@@ -2764,10 +2748,6 @@ describe('<CourseUnit />', () => {
27642748 it ( 'should update the group access in the unit sidebar' , async ( ) => {
27652749 const user = userEvent . setup ( ) ;
27662750
2767- setConfig ( {
2768- ...getConfig ( ) ,
2769- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2770- } ) ;
27712751 render ( < RootWrapper /> ) ;
27722752
27732753 axiosMock
@@ -2843,10 +2823,6 @@ describe('<CourseUnit />', () => {
28432823 } ) ;
28442824
28452825 it ( 'should one group in the visibility field in the unit sidebar' , async ( ) => {
2846- setConfig ( {
2847- ...getConfig ( ) ,
2848- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2849- } ) ;
28502826 render ( < RootWrapper /> ) ;
28512827
28522828 axiosMock
@@ -2898,10 +2874,6 @@ describe('<CourseUnit />', () => {
28982874 } ) ;
28992875
29002876 it ( 'should multiple groups in the visibility field in the unit sidebar' , async ( ) => {
2901- setConfig ( {
2902- ...getConfig ( ) ,
2903- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2904- } ) ;
29052877 render ( < RootWrapper /> ) ;
29062878
29072879 axiosMock
@@ -2958,10 +2930,6 @@ describe('<CourseUnit />', () => {
29582930 } ) ;
29592931
29602932 it ( 'should render never published state in the unit sidebar' , async ( ) => {
2961- setConfig ( {
2962- ...getConfig ( ) ,
2963- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2964- } ) ;
29652933 render ( < RootWrapper /> ) ;
29662934
29672935 axiosMock
@@ -2988,10 +2956,6 @@ describe('<CourseUnit />', () => {
29882956 } ) ;
29892957
29902958 it ( 'displays the scheduled state in the status bar' , async ( ) => {
2991- setConfig ( {
2992- ...getConfig ( ) ,
2993- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2994- } ) ;
29952959 axiosMock
29962960 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
29972961 . reply ( 200 , {
@@ -3008,10 +2972,6 @@ describe('<CourseUnit />', () => {
30082972 } ) ;
30092973
30102974 it ( 'displays the draft changes state in the status bar' , async ( ) => {
3011- setConfig ( {
3012- ...getConfig ( ) ,
3013- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
3014- } ) ;
30152975 axiosMock
30162976 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
30172977 . reply ( 200 , {
@@ -3028,10 +2988,6 @@ describe('<CourseUnit />', () => {
30282988 } ) ;
30292989
30302990 it ( 'displays discussions enabled label in the status bar' , async ( ) => {
3031- setConfig ( {
3032- ...getConfig ( ) ,
3033- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
3034- } ) ;
30352991 axiosMock
30362992 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
30372993 . reply ( 200 , {
@@ -3047,10 +3003,6 @@ describe('<CourseUnit />', () => {
30473003 } ) ;
30483004
30493005 it ( 'displays group access with one group in the status bar' , async ( ) => {
3050- setConfig ( {
3051- ...getConfig ( ) ,
3052- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
3053- } ) ;
30543006 axiosMock
30553007 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
30563008 . reply ( 200 , {
@@ -3094,10 +3046,6 @@ describe('<CourseUnit />', () => {
30943046 } ) ;
30953047
30963048 it ( 'displays group access with multiple groups in the status bar' , async ( ) => {
3097- setConfig ( {
3098- ...getConfig ( ) ,
3099- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
3100- } ) ;
31013049 axiosMock
31023050 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
31033051 . reply ( 200 , {
@@ -3144,7 +3092,6 @@ describe('<CourseUnit />', () => {
31443092 setConfig ( {
31453093 ...getConfig ( ) ,
31463094 ENABLE_TAGGING_TAXONOMY_PAGES : 'true' ,
3147- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
31483095 } ) ;
31493096
31503097 render ( < RootWrapper /> ) ;
@@ -3175,11 +3122,6 @@ describe('<CourseUnit />', () => {
31753122 } ;
31763123
31773124 beforeEach ( async ( ) => {
3178- setConfig ( {
3179- ...getConfig ( ) ,
3180- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
3181- } ) ;
3182-
31833125 // The Meilisearch client-side API uses fetch, not Axios.
31843126 fetchMock . mockReset ( ) ;
31853127 fetchMock . post ( searchEndpoint , ( _url , req ) => {
@@ -3430,10 +3372,6 @@ describe('<CourseUnit />', () => {
34303372 } ) ;
34313373
34323374 it ( 'not render add sidebar in units from libraries (read-only)' , async ( ) => {
3433- setConfig ( {
3434- ...getConfig ( ) ,
3435- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
3436- } ) ;
34373375 render ( < RootWrapper /> ) ;
34383376
34393377 axiosMock
@@ -3466,11 +3404,6 @@ describe('<CourseUnit />', () => {
34663404 } ) ;
34673405
34683406 it ( 'opens the component info sidebar on postMessage event' , async ( ) => {
3469- setConfig ( {
3470- ...getConfig ( ) ,
3471- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
3472- } ) ;
3473-
34743407 axiosMock
34753408 . onGet ( getXBlockApiUrl ( mockContentData . textXBlock ) )
34763409 . reply ( 200 , mockContentData . textXBlockData ) ;
@@ -3498,7 +3431,6 @@ describe('<CourseUnit />', () => {
34983431
34993432 // eslint-disable-next-line @typescript-eslint/no-explicit-any
35003433 const renderComponentSidebar = async ( data : any = componentData ) => {
3501- setConfig ( { ...getConfig ( ) , ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' } ) ;
35023434 axiosMock . onGet ( getXBlockApiUrl ( componentId ) ) . reply ( 200 , data ) ;
35033435 render ( < RootWrapper /> ) ;
35043436 await screen . findByTitle ( xblockContainerIframeMessages . xblockIframeTitle . defaultMessage ) ;
@@ -3637,7 +3569,6 @@ describe('<CourseUnit />', () => {
36373569
36383570 // eslint-disable-next-line @typescript-eslint/no-explicit-any
36393571 const renderUnitInfoSidebar = async ( itemData : any = unitItemData ) => {
3640- setConfig ( { ...getConfig ( ) , ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' } ) ;
36413572 axiosMock . onGet ( getXBlockApiUrl ( unitId ) ) . reply ( 200 , itemData ) ;
36423573 render ( < RootWrapper /> ) ;
36433574 // Wait for the Details tab which is unique to the new unit info sidebar
0 commit comments