1+ import { getConfig , setConfig } from '@edx/frontend-platform' ;
12import { COMPONENT_TYPES } from '@src/generic/block-type-utils/constants' ;
23import {
34 act , fireEvent , initializeMocks , render , screen , waitFor , within ,
45} from '@src/testUtils' ;
56import { XBlock } from '@src/data/types' ;
67import cardHeaderMessages from '../card-header/messages' ;
78import SubsectionCard from './SubsectionCard' ;
8- import { SidebarProvider } from '../common/context/SidebarContext ' ;
9+ import { OutlineSidebarProvider } from '../outline-sidebar/OutlineSidebarContext ' ;
910
1011let store ;
1112const containerKey = 'lct:org:lib:unit:1' ;
@@ -107,7 +108,7 @@ const section: XBlock = {
107108const onEditSubectionSubmit = jest . fn ( ) ;
108109
109110const renderComponent = ( props ?: object , entry = '/course/:courseId' ) => render (
110- < SidebarProvider >
111+ < OutlineSidebarProvider >
111112 < SubsectionCard
112113 section = { section }
113114 subsection = { subsection }
@@ -131,7 +132,7 @@ const renderComponent = (props?: object, entry = '/course/:courseId') => render(
131132 >
132133 < span > children</ span >
133134 </ SubsectionCard >
134- </ SidebarProvider > ,
135+ </ OutlineSidebarProvider > ,
135136 {
136137 path : '/course/:courseId' ,
137138 params : { courseId : '5' } ,
@@ -158,6 +159,10 @@ describe('<SubsectionCard />', () => {
158159 } ) ;
159160
160161 it ( 'render SubsectionCard component in selected state' , ( ) => {
162+ setConfig ( {
163+ ...getConfig ( ) ,
164+ ENABLE_COURSE_OUTLINE_NEW_DESIGN : 'true' ,
165+ } ) ;
161166 const { container } = renderComponent ( ) ;
162167
163168 expect ( screen . getByTestId ( 'subsection-card-header' ) ) . toBeInTheDocument ( ) ;
0 commit comments