UNPKG

@wordpress/e2e-test-utils

Version:
23 lines (22 loc) 604 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setPostContent = setPostContent; /** * Sets code editor content * * @param {string} content New code editor content. * * @return {Promise} Promise resolving with an array containing all blocks in the document. */ async function setPostContent(content) { return await page.evaluate(_content => { const { dispatch } = window.wp.data; const blocks = wp.blocks.parse(_content); dispatch('core/block-editor').resetBlocks(blocks); }, content); } //# sourceMappingURL=set-post-content.js.map