@@ -132,6 +132,24 @@ describe('Outline Tab', () => {
132132 expect ( expandedSectionNode ) . toHaveAttribute ( 'aria-expanded' , 'true' ) ;
133133 } ) ;
134134
135+ it ( 'displays correct heading for expanded section' , async ( ) => {
136+ const { courseBlocks } = await buildMinimalCourseBlocks ( courseId , 'Title' , { resumeBlock : true } ) ;
137+ setTabData ( { course_blocks : { blocks : courseBlocks . blocks } } ) ;
138+ await fetchAndRender ( ) ;
139+ const headingContent = screen . getByText ( 'Title of Section' ) ;
140+ const { parentElement } = headingContent ;
141+ expect ( parentElement . tagName ) . toBe ( 'H2' ) ;
142+ } ) ;
143+
144+ it ( 'checks that the expanded section is within the correct list' , async ( ) => {
145+ const { courseBlocks } = await buildMinimalCourseBlocks ( courseId , 'Title' , { resumeBlock : true } ) ;
146+ setTabData ( { course_blocks : { blocks : courseBlocks . blocks } } ) ;
147+ await fetchAndRender ( ) ;
148+ const listElement = screen . getByRole ( 'presentation' , { id : 'courseHome-outline' } ) ;
149+ expect ( listElement ) . toBeInTheDocument ( ) ;
150+ expect ( listElement . tagName ) . toBe ( 'OL' ) ;
151+ } ) ;
152+
135153 it ( 'includes outline_tab_notifications_slot' , async ( ) => {
136154 const { courseBlocks } = await buildMinimalCourseBlocks ( courseId , 'Title' , { resumeBlock : true } ) ;
137155 setTabData ( {
0 commit comments