@@ -38,12 +38,14 @@ jest.mock('@src/course-outline/CourseOutlineContext', () => ({
3838} ) ) ;
3939
4040const startCurrentFlow = jest . fn ( ) ;
41+ const openContainerInfoSidebar = jest . fn ( ) ;
4142let currentFlow : OutlineFlow | null = null ;
4243jest . mock ( '@src/course-outline/outline-sidebar/OutlineSidebarContext' , ( ) => ( {
4344 ...jest . requireActual ( '@src/course-outline/outline-sidebar/OutlineSidebarContext' ) ,
4445 useOutlineSidebarContext : ( ) => ( {
4546 ...jest . requireActual ( '@src/course-outline/outline-sidebar/OutlineSidebarContext' ) . useOutlineSidebarContext ( ) ,
4647 startCurrentFlow,
48+ openContainerInfoSidebar,
4749 currentFlow,
4850 isCurrentFlowOn : ! ! currentFlow ,
4951 } ) ,
@@ -113,6 +115,8 @@ jest.mock('@src/course-outline/outline-sidebar/OutlineSidebarContext', () => ({
113115 expect . objectContaining ( { onSuccess : expect . any ( Function ) } ) ,
114116 )
115117 ) ;
118+ handleAddBlock . mutateAsync . mock . calls [ 0 ] [ 1 ] . onSuccess ( { locator : 'new-section-id' } ) ;
119+ expect ( openContainerInfoSidebar ) . toHaveBeenCalledWith ( 'new-section-id' , undefined , 'new-section-id' ) ;
116120 break ;
117121 case ContainerType . Subsection :
118122 await waitFor ( ( ) =>
@@ -126,6 +130,12 @@ jest.mock('@src/course-outline/outline-sidebar/OutlineSidebarContext', () => ({
126130 expect . objectContaining ( { onSuccess : expect . any ( Function ) } ) ,
127131 )
128132 ) ;
133+ handleAddBlock . mutateAsync . mock . calls [ 0 ] [ 1 ] . onSuccess ( { locator : 'new-subsection-id' } ) ;
134+ expect ( openContainerInfoSidebar ) . toHaveBeenCalledWith (
135+ 'new-subsection-id' ,
136+ 'new-subsection-id' ,
137+ parentLocator ,
138+ ) ;
129139 break ;
130140 case ContainerType . Unit :
131141 await waitFor ( ( ) =>
0 commit comments