@@ -2360,38 +2360,36 @@ describe('<CourseUnit />', () => {
23602360 } ) ;
23612361 } ) ;
23622362
2363- it ( 'resets XBlock publish state after saving XBlock changes' , async ( ) => {
2364- store = initializeStore ( ) ;
2365- mockedUsedNavigate . mockClear ( ) ;
2366-
2367- axiosMock
2368- . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
2369- . reply ( 200 , {
2370- ...courseSectionVerticalMock ,
2371- xblock_info : {
2372- ...courseSectionVerticalMock . xblock_info ,
2373- published : true , // Must have been published before
2374- has_changes : true , // And now have changes
2375- } ,
2376- } ) ;
2377-
2378- render ( < RootWrapper /> ) ;
2379-
2380- const xblocksIframe = await screen . findByTitle ( xblockContainerIframeMessages . xblockIframeTitle . defaultMessage ) ;
2381- expect ( xblocksIframe ) . toBeInTheDocument ( ) ;
2382-
2383- const courseUnitSidebar = await screen . findByTestId ( 'course-unit-sidebar' ) ;
2384-
2385- await waitFor ( ( ) => {
2363+ it ( 'resets XBlock publish state after saving XBlock changes' , async ( ) => {
2364+ store = initializeStore ( ) ;
2365+ mockedUsedNavigate . mockClear ( ) ;
2366+
2367+ axiosMock
2368+ . onGet ( getCourseSectionVerticalApiUrl ( blockId ) )
2369+ . reply ( 200 , {
2370+ ...courseSectionVerticalMock ,
2371+ xblock_info : {
2372+ ...courseSectionVerticalMock . xblock_info ,
2373+ published : true , // Must have been published before
2374+ has_changes : true , // And now have changes
2375+ } ,
2376+ } ) ;
2377+
2378+ render ( < RootWrapper /> ) ;
2379+
2380+ const xblocksIframe = await screen . findByTitle ( xblockContainerIframeMessages . xblockIframeTitle . defaultMessage ) ;
2381+ expect ( xblocksIframe ) . toBeInTheDocument ( ) ;
2382+
2383+ const courseUnitSidebar = await screen . findByTestId ( 'course-unit-sidebar' ) ;
2384+
2385+ await waitFor ( ( ) => {
23862386 // Verify the publish button is present (indicates unpublished changes)
2387- expect ( within ( courseUnitSidebar )
2388- . getByRole ( 'button' , { name : sidebarMessages . actionButtonPublishTitle . defaultMessage } )
2389- ) . toBeInTheDocument ( ) ;
2390-
2391- // Verify discard changes button is present (confirms unpublished changes)
2392- expect ( within ( courseUnitSidebar )
2393- . getByRole ( 'button' , { name : sidebarMessages . actionButtonDiscardChangesTitle . defaultMessage } )
2394- ) . toBeInTheDocument ( ) ;
2387+ expect ( within ( courseUnitSidebar )
2388+ . getByRole ( 'button' , { name : sidebarMessages . actionButtonPublishTitle . defaultMessage } ) ) . toBeInTheDocument ( ) ;
2389+
2390+ // Verify discard changes button is present (confirms unpublished changes)
2391+ expect ( within ( courseUnitSidebar )
2392+ . getByRole ( 'button' , { name : sidebarMessages . actionButtonDiscardChangesTitle . defaultMessage } ) ) . toBeInTheDocument ( ) ;
2393+ } ) ;
23952394 } ) ;
23962395} ) ;
2397- } ) ;
0 commit comments