@@ -165,6 +165,7 @@ describe('DocumentationTopic', () => {
165165 wrapper = shallowMount ( DocumentationTopic , {
166166 propsData,
167167 provide : {
168+ isTargetIDE : false ,
168169 store : {
169170 state : { onThisPageSections : [ ] , references : { } } ,
170171 reset : jest . fn ( ) ,
@@ -219,13 +220,29 @@ describe('DocumentationTopic', () => {
219220 expect ( wrapper . is ( 'div.doc-topic' ) ) . toBe ( true ) ;
220221 } ) ;
221222
222- it ( 'renders a <main>' , ( ) => {
223+ it ( 'renders a <main> in non-IDE mode ' , ( ) => {
223224 const main = wrapper . find ( 'main' ) ;
224225 expect ( main . exists ( ) ) . toBe ( true ) ;
225226 expect ( main . classes ( 'main' ) ) . toBe ( true ) ;
226227 expect ( main . attributes ( 'id' ) ) . toBe ( 'main' ) ;
227- expect ( main . attributes ( 'role' ) ) . toBe ( 'main' ) ;
228- expect ( main . attributes ( 'tabindex' ) ) . toBe ( '0' ) ;
228+ } ) ;
229+
230+ it ( 'renders a <div> instead of <main> in IDE mode' , ( ) => {
231+ wrapper = shallowMount ( DocumentationTopic , {
232+ propsData,
233+ provide : {
234+ isTargetIDE : true ,
235+ store : {
236+ state : { onThisPageSections : [ ] , references : { } } ,
237+ reset : jest . fn ( ) ,
238+ } ,
239+ } ,
240+ } ) ;
241+
242+ expect ( wrapper . find ( 'main' ) . exists ( ) ) . toBe ( false ) ;
243+ const div = wrapper . find ( '.main' ) ;
244+ expect ( div . exists ( ) ) . toBe ( true ) ;
245+ expect ( div . attributes ( 'id' ) ) . toBe ( 'main' ) ;
229246 } ) ;
230247
231248 it ( 'renders an aria live that tells VO users which it is the current page content' , ( ) => {
0 commit comments