Skip to content

Commit

Permalink
Improve openAllBlockInserterCategories function; Fix intermittent fai…
Browse files Browse the repository at this point in the history
…lures in inner blocks allowed blocks test. (#14460)
  • Loading branch information
jorgefilipecosta authored Mar 18, 2019
1 parent 7748b8e commit 15b20c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* Opens all block inserter categories.
*/
export async function openAllBlockInserterCategories() {
const notOpenCategoryPanels = await page.$$(
'.block-editor-inserter__results .components-panel__body:not(.is-opened)'
);
for ( const categoryPanel of notOpenCategoryPanels ) {
const notOppenedCategorySelector = '.block-editor-inserter__results .components-panel__body:not(.is-opened)';
let categoryPanel = await page.$( notOppenedCategorySelector );
while ( categoryPanel !== null ) {
await categoryPanel.click();
categoryPanel = await page.$( notOppenedCategorySelector );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ import {
openGlobalBlockInserter,
} from '@wordpress/e2e-test-utils';

// Todo: Understand why this test causing intermitent fails on travis.
// Error: ● Allowed Blocks Setting on InnerBlocks › allows all blocks if the allowed blocks setting was not set
// Node is detached from document
// at ElementHandle._scrollIntoViewIfNeeded (../../node_modules/puppeteer/lib/ElementHandle.js:75:13)
// eslint-disable-next-line jest/no-disabled-tests
describe.skip( 'Allowed Blocks Setting on InnerBlocks ', () => {
describe( 'Allowed Blocks Setting on InnerBlocks ', () => {
const paragraphSelector = '.block-editor-rich-text__editable.wp-block-paragraph';
beforeAll( async () => {
await activatePlugin( 'gutenberg-test-innerblocks-allowed-blocks' );
Expand Down

0 comments on commit 15b20c7

Please sign in to comment.