@@ -237,42 +237,16 @@ describe('WAI ARIA Spec', () => {
237237 } ) ;
238238
239239 describe ( 'WAI-ARIA Roles, States, and Properties' , ( ) => {
240- it ( `The title of each accordion header is contained in an element with
241- role button.` , async ( ) => {
242- // TODO: Use 'title' elements inside the headings.
243-
244- const { browser, page, buttonsHandles } = await setup ( ) ;
245- expect ( buttonsHandles ) . toHaveLength ( 3 ) ;
246- for ( const buttonHandle of buttonsHandles ) {
247- expect (
248- await page . evaluate (
249- ( button ) => button . getAttribute ( 'role' ) ,
250- buttonHandle ,
251- ) ,
252- ) . toBe ( 'button' ) ;
253- }
254- } ) ;
255-
256- it ( `Each accordion header button is wrapped in an element with role
257- heading that has a value set for aria-level that is appropriate for
258- the information architecture of the page.` , async ( ) => {
259- const { browser, page, buttonsHandles } = await setup ( ) ;
260- expect ( buttonsHandles ) . toHaveLength ( 3 ) ;
261- for ( const buttonHandle of buttonsHandles ) {
262- expect (
263- await page . evaluate (
264- ( button ) => button . parentElement . getAttribute ( 'role' ) ,
265- buttonHandle ,
266- ) ,
267- ) . toBe ( 'heading' ) ;
268-
240+ it ( `The title of each accordion header is contained in a heading tag` , async ( ) => {
241+ const { browser, page, headingsHandles } = await setup ( ) ;
242+ expect ( headingsHandles ) . toHaveLength ( 3 ) ;
243+ for ( const headingsHandle of headingsHandles ) {
269244 expect (
270245 await page . evaluate (
271- ( button ) =>
272- button . parentElement . getAttribute ( 'aria-level' ) ,
273- buttonHandle ,
246+ ( heading ) => heading . tagName ,
247+ headingsHandle ,
274248 ) ,
275- ) . toBeTruthy ( ) ;
249+ ) . toContain ( 'H3' ) ;
276250 }
277251 } ) ;
278252
0 commit comments