Skip to content

Commit

Permalink
Add doc block comment
Browse files Browse the repository at this point in the history
  • Loading branch information
glendaviesnz committed Mar 26, 2023
1 parent b0f0746 commit 8948961
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/cover/test/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {

async function setup( attributes ) {
const testBlock = { name: 'core/cover', attributes };
return initializeEditor( { testBlocks: testBlock } );
return initializeEditor( testBlock );
}

async function createAndselectBlock() {
Expand Down
19 changes: 14 additions & 5 deletions test/integration/helpers/integration-test-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,18 @@ export function Editor( { testBlocks, settings = {} } ) {
);
}

export async function initializeEditor( {
useCoreBlocks = true,
/**
* Registers the core block, creates the test block instances, and then instantiates the Editor.
*
* @param {Object | Array} testBlocks Block or array of block settings for blocks to be tested.
* @param {boolean} useCoreBlocks Defaults to true. If false, core blocks will not be registered.
* @param {Object} settings Any additional editor settings to be passed to the editor.
*/
export async function initializeEditor(
testBlocks,
...props
} ) {
useCoreBlocks = true,
settings
) {
if ( useCoreBlocks ) {
registerCoreBlocks();
}
Expand All @@ -112,6 +119,8 @@ export async function initializeEditor( {
)
);
return waitForStoreResolvers( () => {
return render( <Editor testBlocks={ newBlocks } { ...props } /> );
return render(
<Editor testBlocks={ newBlocks } settings={ settings } />
);
} );
}

0 comments on commit 8948961

Please sign in to comment.