@@ -7,18 +7,24 @@ describe( 'Column Block', () => {
77 } ) ;
88
99 it ( 'Column block should not be available in block inserter' , ( ) => {
10+ // Intercept block directory request
11+ cy . intercept (
12+ '/index.php?rest_route=%2Fwp%2Fv2%2Fblock-directory%2Fsearch&term=*' ,
13+ {
14+ body : [ ] ,
15+ }
16+ ) ;
1017 cy . searchForBlock ( 'Bootstrap Column' ) ;
1118
12- // eslint-disable-next-line jest/valid-expect-in-promise
13- cy . window ( ) . then ( ( window ) => {
14- const noResultPreWP55 = window . document . querySelector (
15- '.block-editor-inserter__no-results'
16- ) ;
17- const noResultWP55 = window . document . querySelector (
18- '.block-editor-inserter__content .has-no-results'
19- ) ;
20- cy . wrap ( noResultPreWP55 || noResultWP55 ) . should ( 'exist' ) ;
21- } ) ;
19+ const noResultsSelectorPreWP55 =
20+ '//div[contains(@class,"block-editor-inserter__no-results")]' ;
21+ const noResultsSelectorWP55 =
22+ '//div[contains(@class,"block-editor-inserter__content")]//div[contains(@class,"has-no-results")]' ;
23+ const noResultsSelectorWP57 =
24+ '//p[contains(@class,"block-directory-downloadable-blocks-panel__description") and contains(@class,"has-no-results")]' ;
25+ cy . xpath (
26+ `${ noResultsSelectorPreWP55 } | ${ noResultsSelectorWP55 } | ${ noResultsSelectorWP57 } `
27+ ) . should ( 'exist' ) ;
2228 } ) ;
2329
2430 it ( 'Column block should be initialized with default attributes' , ( ) => {
0 commit comments