Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it( 'should display non-template reusable blocks in the regular block editor', async () => {
await createNewPost();
await searchForBlock( 'Reusable' );
await expect( page ).not.toMatchElement( '.block-editor-inserter__no-results' );
} );
} );
it( 'Column block should not be available in block inserter', async () => {
expect( console ).toHaveWarned();
await searchForBlock( 'Bootstrap Column' );
expect( await page.$( '.block-editor-inserter__no-results' ) ).not.toBeNull();
} );
it( 'should hide story templates in the regular block editor', async () => {
await createNewPost();
await searchForBlock( 'Template' );
await expect( page ).toMatchElement( '.block-editor-inserter__no-results' );
} );
export const insertRowBlock = async () => {
await searchForBlock( 'Bootstrap Row' );
await page.click( 'button.editor-block-list-item-wp-bootstrap-blocks-row' );
};
async insertBlock( blockName, blockTitle ) {
await searchForBlock( blockTitle );
const blockIconSelector = `.editor-block-list-item-jetpack-${ blockName }`;
const jetpackPanelSelector = '.components-panel__body .jetpack-logo';
await scrollIntoView( this.page, jetpackPanelSelector );
await waitAndClick( this.page, blockIconSelector );
const blockInfo = await this.getInsertedBlock();
return blockInfo;
}