@@ -32,7 +32,7 @@ describe('@storyblok/vue', () => {
32
32
beforeEach ( ( ) => {
33
33
cy . spy ( window . console , 'log' ) . as ( 'log' ) ;
34
34
cy . spy ( window . console , 'error' ) . as ( 'error' ) ;
35
- delete window . storyblokRegisterEvent ;
35
+ delete ( window as any ) . storyblokRegisterEvent ;
36
36
document . getElementById ( 'storyblok-javascript-bridge' ) ?. remove ( ) ;
37
37
} ) ;
38
38
@@ -206,51 +206,28 @@ describe('@storyblok/vue', () => {
206
206
components : { Teaser, Grid, Page, Feature } ,
207
207
} ) ;
208
208
209
- cy . get ( '[data-test=root]' )
210
- . children ( )
211
- . find ( 'h1' )
212
- . should ( 'have.text' , 'Headline 1' ) ;
209
+ cy . contains ( 'h1' , 'Headline 1' , { timeout : 1000 } ) ;
213
210
} ) ;
214
211
215
212
it ( 'Should render headline tags correctly' , ( ) => {
216
213
prepare ( { use : [ apiPlugin ] } , RichText , {
217
214
components : { Teaser, Grid, Page, Feature } ,
218
215
} ) ;
219
216
220
- cy . get ( '[data-test=root]' )
221
- . children ( )
222
- . find ( 'h1' )
223
- . should ( 'have.text' , 'Headline 1' ) ;
224
- cy . get ( '[data-test=root]' )
225
- . children ( )
226
- . find ( 'h2' )
227
- . should ( 'have.text' , 'Headline 2' ) ;
228
- cy . get ( '[data-test=root]' )
229
- . children ( )
230
- . find ( 'h3' )
231
- . should ( 'have.text' , 'Headline 3' ) ;
232
- cy . get ( '[data-test=root]' )
233
- . children ( )
234
- . find ( 'h4' )
235
- . should ( 'have.text' , 'Headline 4' ) ;
236
- cy . get ( '[data-test=root]' )
237
- . children ( )
238
- . find ( 'h5' )
239
- . should ( 'have.text' , 'Headline 5' ) ;
240
- cy . get ( '[data-test=root]' )
241
- . children ( )
242
- . find ( 'h6' )
243
- . should ( 'have.text' , 'Headline 6' ) ;
217
+ cy . contains ( 'h1' , 'Headline 1' , { timeout : 1000 } ) ;
218
+ cy . contains ( 'h2' , 'Headline 2' , { timeout : 1000 } ) ;
219
+ cy . contains ( 'h3' , 'Headline 3' , { timeout : 1000 } ) ;
220
+ cy . contains ( 'h4' , 'Headline 4' , { timeout : 1000 } ) ;
221
+ cy . contains ( 'h5' , 'Headline 5' , { timeout : 1000 } ) ;
222
+ cy . contains ( 'h6' , 'Headline 6' , { timeout : 1000 } ) ;
244
223
} ) ;
245
224
246
225
it ( 'Should render images correctly' , ( ) => {
247
226
prepare ( { use : [ apiPlugin ] } , RichText , {
248
227
components : { Teaser, Grid, Page, Feature } ,
249
228
} ) ;
250
229
251
- cy . get ( '[data-test=root]' )
252
- . children ( )
253
- . find ( 'img' )
230
+ cy . get ( 'img' )
254
231
. should (
255
232
'have.attr' ,
256
233
'src' ,
@@ -263,9 +240,7 @@ describe('@storyblok/vue', () => {
263
240
components : { Teaser, Grid, Page, Feature } ,
264
241
} ) ;
265
242
266
- cy . get ( '[data-test=root]' )
267
- . children ( )
268
- . find ( 'a' )
243
+ cy . get ( 'a' )
269
244
. should ( 'have.attr' , 'href' , 'https://storyblok.com/' ) ;
270
245
} ) ;
271
246
@@ -274,10 +249,9 @@ describe('@storyblok/vue', () => {
274
249
components : { IframeEmbed } ,
275
250
} ) ;
276
251
277
- cy . get ( '[data-test=root]' )
278
- . children ( )
279
- . find ( 'iframe' )
280
- . should ( 'have.attr' , 'src' , 'https://storyblok.com/' ) ;
252
+ cy . get ( 'iframe' )
253
+ . should ( 'exist' )
254
+ . and ( 'have.attr' , 'src' , 'https://storyblok.com/' ) ;
281
255
} ) ;
282
256
283
257
it ( 'should redirect internal links' , ( ) => {
0 commit comments