@@ -281,7 +281,7 @@ describe('<CourseUnit />', () => {
281281 } ,
282282 } ) ;
283283
284- const courseUnitSidebar = await screen . findByTestId ( 'course-unit- sidebar') ;
284+ const courseUnitSidebar = screen . getByTestId ( ' sidebar') ;
285285 expect (
286286 within ( courseUnitSidebar ) . getByText ( legacySidebarMessages . sidebarTitleDraftUnpublishedChanges . defaultMessage ) ,
287287 ) . toBeInTheDocument ( ) ;
@@ -313,7 +313,7 @@ describe('<CourseUnit />', () => {
313313 } ,
314314 } ) ;
315315
316- const courseUnitSidebar = await screen . findByTestId ( 'course-unit- sidebar') ;
316+ const courseUnitSidebar = screen . getByTestId ( ' sidebar') ;
317317 expect (
318318 within ( courseUnitSidebar ) . getByText ( legacySidebarMessages . sidebarTitleDraftUnpublishedChanges . defaultMessage ) ,
319319 ) . toBeInTheDocument ( ) ;
@@ -1112,7 +1112,7 @@ describe('<CourseUnit />', () => {
11121112 let visibilityCheckbox ;
11131113
11141114 await waitFor ( async ( ) => {
1115- courseUnitSidebar = screen . getByTestId ( 'course-unit- sidebar' ) ;
1115+ courseUnitSidebar = screen . getByTestId ( 'sidebar' ) ;
11161116
11171117 draftUnpublishedChangesHeading = within ( courseUnitSidebar )
11181118 . getByText ( legacySidebarMessages . sidebarTitleDraftUnpublishedChanges . defaultMessage ) ;
@@ -1189,7 +1189,7 @@ describe('<CourseUnit />', () => {
11891189 let publishBtn ;
11901190
11911191 await waitFor ( async ( ) => {
1192- courseUnitSidebar = screen . getByTestId ( 'course-unit- sidebar' ) ;
1192+ courseUnitSidebar = screen . getByTestId ( 'sidebar' ) ;
11931193 publishBtn = within ( courseUnitSidebar ) . queryByRole ( 'button' , { name : legacySidebarMessages . actionButtonPublishTitle . defaultMessage } ) ;
11941194 expect ( publishBtn ) . toBeInTheDocument ( ) ;
11951195
@@ -1232,7 +1232,7 @@ describe('<CourseUnit />', () => {
12321232 let discardChangesBtn ;
12331233
12341234 await waitFor ( async ( ) => {
1235- courseUnitSidebar = screen . getByTestId ( 'course-unit- sidebar' ) ;
1235+ courseUnitSidebar = screen . getByTestId ( 'sidebar' ) ;
12361236
12371237 const draftUnpublishedChangesHeading = within ( courseUnitSidebar )
12381238 . getByText ( legacySidebarMessages . sidebarTitleDraftUnpublishedChanges . defaultMessage ) ;
@@ -1294,7 +1294,7 @@ describe('<CourseUnit />', () => {
12941294 let restrictAccessSelect ;
12951295
12961296 await waitFor ( async ( ) => {
1297- courseUnitSidebar = screen . getByTestId ( 'course-unit- sidebar' ) ;
1297+ courseUnitSidebar = screen . getByTestId ( 'sidebar' ) ;
12981298 sidebarVisibilityCheckbox = within ( courseUnitSidebar )
12991299 . getByLabelText ( unitInfoMessages . visibilityCheckboxTitle . defaultMessage ) ;
13001300 expect ( sidebarVisibilityCheckbox ) . not . toBeChecked ( ) ;
@@ -2031,34 +2031,6 @@ describe('<CourseUnit />', () => {
20312031 } ) ;
20322032 } ;
20332033
2034- const checkRenderVisibilityModal = async ( headingMessageId ) => {
2035- const user = userEvent . setup ( ) ;
2036- const { findByRole, getByTestId } = render ( < RootWrapper /> ) ;
2037- let configureModal ;
2038- let restrictAccessSelect ;
2039-
2040- const headerConfigureBtn = await findByRole ( 'button' , { name : / s e t t i n g s / i } ) ;
2041- await user . click ( headerConfigureBtn ) ;
2042-
2043- await waitFor ( ( ) => {
2044- configureModal = getByTestId ( 'configure-modal' ) ;
2045- restrictAccessSelect = within ( configureModal )
2046- . getByRole ( 'combobox' , { name : configureModalMessages . restrictAccessTo . defaultMessage } ) ;
2047- expect ( within ( configureModal )
2048- . getByRole ( 'heading' , { name : configureModalMessages [ headingMessageId ] . defaultMessage } ) ) . toBeInTheDocument ( ) ;
2049- expect ( within ( configureModal )
2050- . queryByText ( configureModalMessages . unitVisibility . defaultMessage ) ) . not . toBeInTheDocument ( ) ;
2051- expect ( within ( configureModal )
2052- . getByText ( configureModalMessages . restrictAccessTo . defaultMessage ) ) . toBeInTheDocument ( ) ;
2053- expect ( restrictAccessSelect ) . toBeInTheDocument ( ) ;
2054- expect ( restrictAccessSelect ) . toHaveValue ( '-1' ) ;
2055- } ) ;
2056-
2057- const modalSaveBtn = within ( configureModal )
2058- . getByRole ( 'button' , { name : configureModalMessages . saveButton . defaultMessage } ) ;
2059- await user . click ( modalSaveBtn ) ;
2060- } ;
2061-
20622034 describe ( 'Library Content page' , ( ) => {
20632035 const newUnitId = '12345' ;
20642036
@@ -2116,10 +2088,6 @@ describe('<CourseUnit />', () => {
21162088 } ) ;
21172089 } ) ;
21182090
2119- it ( 'should display visibility modal correctly' , async ( ) => (
2120- checkRenderVisibilityModal ( 'libraryContentAccess' )
2121- ) ) ;
2122-
21232091 it ( 'opens legacy edit modal on edit button click' , checkLegacyEditModalOnEditMessage ) ;
21242092 } ) ;
21252093
@@ -2255,10 +2223,6 @@ describe('<CourseUnit />', () => {
22552223 } ) ;
22562224 } ) ;
22572225
2258- it ( 'should display visibility modal correctly' , async ( ) => (
2259- checkRenderVisibilityModal ( 'splitTestAccess' )
2260- ) ) ;
2261-
22622226 it ( 'opens legacy edit modal on edit button click' , checkLegacyEditModalOnEditMessage ) ;
22632227 } ) ;
22642228
@@ -2332,7 +2296,7 @@ describe('<CourseUnit />', () => {
23322296 expect ( editButton ) . toBeEnabled ( ) ;
23332297
23342298 // The "Publish" button should still be enabled
2335- const courseUnitSidebar = screen . getByTestId ( 'course-unit- sidebar' ) ;
2299+ const courseUnitSidebar = screen . getByTestId ( 'sidebar' ) ;
23362300 const publishButton = within ( courseUnitSidebar ) . getByRole (
23372301 'button' ,
23382302 { name : legacySidebarMessages . actionButtonPublishTitle . defaultMessage } ,
@@ -2344,11 +2308,7 @@ describe('<CourseUnit />', () => {
23442308 expect ( screen . queryByText ( addComponentMessages . title . defaultMessage ) ) . not . toBeInTheDocument ( ) ;
23452309 } ) ;
23462310
2347- it ( 'renders new unit info/settings sidebar' , async ( ) => {
2348- setConfig ( {
2349- ...getConfig ( ) ,
2350- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2351- } ) ;
2311+ it ( 'renders unit info/settings sidebar' , async ( ) => {
23522312 const user = userEvent . setup ( ) ;
23532313 render ( < RootWrapper /> ) ;
23542314
@@ -2373,10 +2333,6 @@ describe('<CourseUnit />', () => {
23732333 } ) ;
23742334
23752335 it ( 'displays the live state in the status bar' , async ( ) => {
2376- setConfig ( {
2377- ...getConfig ( ) ,
2378- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2379- } ) ;
23802336 axiosMock
23812337 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
23822338 . reply ( 200 , {
@@ -2473,11 +2429,6 @@ describe('<CourseUnit />', () => {
24732429 } ) ;
24742430
24752431 it ( 'displays the staff only state in the status bar' , async ( ) => {
2476- setConfig ( {
2477- ...getConfig ( ) ,
2478- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2479- } ) ;
2480-
24812432 axiosMock
24822433 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
24832434 . reply ( 200 , {
@@ -2497,10 +2448,6 @@ describe('<CourseUnit />', () => {
24972448
24982449 it ( 'should disable discussions in the settings sidebar' , async ( ) => {
24992450 const user = userEvent . setup ( ) ;
2500- setConfig ( {
2501- ...getConfig ( ) ,
2502- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2503- } ) ;
25042451 render ( < RootWrapper /> ) ;
25052452
25062453 axiosMock
@@ -2553,11 +2500,6 @@ describe('<CourseUnit />', () => {
25532500
25542501 it ( 'should update the group access in the unit sidebar' , async ( ) => {
25552502 const user = userEvent . setup ( ) ;
2556-
2557- setConfig ( {
2558- ...getConfig ( ) ,
2559- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2560- } ) ;
25612503 render ( < RootWrapper /> ) ;
25622504
25632505 axiosMock
@@ -2633,10 +2575,6 @@ describe('<CourseUnit />', () => {
26332575 } ) ;
26342576
26352577 it ( 'should one group in the visibility field in the unit sidebar' , async ( ) => {
2636- setConfig ( {
2637- ...getConfig ( ) ,
2638- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2639- } ) ;
26402578 render ( < RootWrapper /> ) ;
26412579
26422580 axiosMock
@@ -2688,10 +2626,6 @@ describe('<CourseUnit />', () => {
26882626 } ) ;
26892627
26902628 it ( 'should multiple groups in the visibility field in the unit sidebar' , async ( ) => {
2691- setConfig ( {
2692- ...getConfig ( ) ,
2693- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2694- } ) ;
26952629 render ( < RootWrapper /> ) ;
26962630
26972631 axiosMock
@@ -2746,10 +2680,6 @@ describe('<CourseUnit />', () => {
27462680 } ) ;
27472681
27482682 it ( 'should render never published state in the unit sidebar' , async ( ) => {
2749- setConfig ( {
2750- ...getConfig ( ) ,
2751- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2752- } ) ;
27532683 render ( < RootWrapper /> ) ;
27542684
27552685 axiosMock
@@ -2776,10 +2706,6 @@ describe('<CourseUnit />', () => {
27762706 } ) ;
27772707
27782708 it ( 'displays the scheduled state in the status bar' , async ( ) => {
2779- setConfig ( {
2780- ...getConfig ( ) ,
2781- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2782- } ) ;
27832709 axiosMock
27842710 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
27852711 . reply ( 200 , {
@@ -2796,10 +2722,6 @@ describe('<CourseUnit />', () => {
27962722 } ) ;
27972723
27982724 it ( 'displays the draft changes state in the status bar' , async ( ) => {
2799- setConfig ( {
2800- ...getConfig ( ) ,
2801- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2802- } ) ;
28032725 axiosMock
28042726 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
28052727 . reply ( 200 , {
@@ -2816,10 +2738,6 @@ describe('<CourseUnit />', () => {
28162738 } ) ;
28172739
28182740 it ( 'displays discussions enabled label in the status bar' , async ( ) => {
2819- setConfig ( {
2820- ...getConfig ( ) ,
2821- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2822- } ) ;
28232741 axiosMock
28242742 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
28252743 . reply ( 200 , {
@@ -2835,10 +2753,6 @@ describe('<CourseUnit />', () => {
28352753 } ) ;
28362754
28372755 it ( 'displays group access with one group in the status bar' , async ( ) => {
2838- setConfig ( {
2839- ...getConfig ( ) ,
2840- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2841- } ) ;
28422756 axiosMock
28432757 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
28442758 . reply ( 200 , {
@@ -2882,10 +2796,6 @@ describe('<CourseUnit />', () => {
28822796 } ) ;
28832797
28842798 it ( 'displays group access with multiple groups in the status bar' , async ( ) => {
2885- setConfig ( {
2886- ...getConfig ( ) ,
2887- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2888- } ) ;
28892799 axiosMock
28902800 . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
28912801 . reply ( 200 , {
@@ -2932,7 +2842,6 @@ describe('<CourseUnit />', () => {
29322842 setConfig ( {
29332843 ...getConfig ( ) ,
29342844 ENABLE_TAGGING_TAXONOMY_PAGES : 'true' ,
2935- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
29362845 } ) ;
29372846
29382847 render ( < RootWrapper /> ) ;
@@ -2963,11 +2872,6 @@ describe('<CourseUnit />', () => {
29632872 } ;
29642873
29652874 beforeEach ( async ( ) => {
2966- setConfig ( {
2967- ...getConfig ( ) ,
2968- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
2969- } ) ;
2970-
29712875 // The Meilisearch client-side API uses fetch, not Axios.
29722876 fetchMock . mockReset ( ) ;
29732877 fetchMock . post ( searchEndpoint , ( _url , req ) => {
@@ -3211,10 +3115,6 @@ describe('<CourseUnit />', () => {
32113115 } ) ;
32123116
32133117 it ( 'not render add sidebar in units from libraries (read-only)' , async ( ) => {
3214- setConfig ( {
3215- ...getConfig ( ) ,
3216- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
3217- } ) ;
32183118 render ( < RootWrapper /> ) ;
32193119
32203120 axiosMock
@@ -3247,11 +3147,6 @@ describe('<CourseUnit />', () => {
32473147 } ) ;
32483148
32493149 it ( 'opens the component info sidebar on postMessage event' , async ( ) => {
3250- setConfig ( {
3251- ...getConfig ( ) ,
3252- ENABLE_UNIT_PAGE_NEW_DESIGN : 'true' ,
3253- } ) ;
3254-
32553150 render ( < RootWrapper /> ) ;
32563151
32573152 await screen . findByTitle ( xblockContainerIframeMessages . xblockIframeTitle . defaultMessage ) ;
0 commit comments