@@ -110,12 +110,12 @@ test.describe('headings', () => {
110110 } ,
111111 } )
112112
113- await expect ( component . getByRole ( 'heading' , { level : 1 } ) ) . toHaveText ( 'heading 1 ')
114- await expect ( component . getByRole ( 'heading' , { level : 2 } ) ) . toHaveText ( 'heading 2 ')
115- await expect ( component . getByRole ( 'heading' , { level : 3 } ) ) . toHaveText ( 'heading 3 ')
116- await expect ( component . getByRole ( 'heading' , { level : 4 } ) ) . toHaveText ( 'heading 4 ')
117- await expect ( component . getByRole ( 'heading' , { level : 5 } ) ) . toHaveText ( 'heading 5 ')
118- await expect ( component . getByRole ( 'heading' , { level : 6 } ) ) . toHaveText ( 'heading 6 ')
113+ await expect ( component . getByText ( 'heading 1' ) ) . toHaveJSProperty ( 'tagName' , 'H4 ')
114+ await expect ( component . getByText ( 'heading 2' ) ) . toHaveJSProperty ( 'tagName' , 'H5 ')
115+ await expect ( component . getByText ( 'heading 3' ) ) . toHaveJSProperty ( 'tagName' , 'H6 ')
116+ await expect ( component . getByText ( 'heading 4' ) ) . toHaveJSProperty ( 'tagName' , 'H6 ')
117+ await expect ( component . getByText ( 'heading 5' ) ) . toHaveJSProperty ( 'tagName' , 'H6 ')
118+ await expect ( component . getByText ( 'heading 6' ) ) . toHaveJSProperty ( 'tagName' , 'H6 ')
119119 } )
120120
121121 test ( 'ignore heading (with hash (#) syntax padded to the text)' , async ( { mount } ) => {
@@ -138,7 +138,7 @@ test.describe('headings', () => {
138138 } ,
139139 } )
140140
141- await expect ( component . getByRole ( 'heading' , { level : 1 } ) ) . toHaveText ( 'heading 1 ')
141+ await expect ( component . getByText ( 'heading 1' ) ) . toHaveJSProperty ( 'tagName' , 'H4 ')
142142 } )
143143
144144 test ( 'render heading 2 (with dash (-) syntax on the next line)' , async ( { mount } ) => {
@@ -149,7 +149,7 @@ test.describe('headings', () => {
149149 } ,
150150 } )
151151
152- await expect ( component . getByRole ( 'heading' , { level : 2 } ) ) . toHaveText ( 'heading 2 ')
152+ await expect ( component . getByText ( 'heading 2' ) ) . toHaveJSProperty ( 'tagName' , 'H5 ')
153153 } )
154154} )
155155
0 commit comments