Skip to content

Commit cdd54fe

Browse files
committed
fix column block test
1 parent 24fee43 commit cdd54fe

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

cypress/integration/column/column-block.spec.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@ 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+
cy.xpath(
24+
`${ noResultsSelectorPreWP55 } | ${ noResultsSelectorWP55 }`
25+
).should( 'exist' );
2226
} );
2327

2428
it( 'Column block should be initialized with default attributes', () => {

0 commit comments

Comments
 (0)