Skip to content

Commit

Permalink
Load our custom block for all tests. This forces the editor to load i…
Browse files Browse the repository at this point in the history
…n a non-iframed state which fixes issues with Cypress
  • Loading branch information
dkotter committed Aug 10, 2023
1 parent 99388b4 commit f85a352
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test-plugin/e2e-test-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,14 @@ function classifai_test_prepare_response( $response ) {
if ( ! defined( 'FS_METHOD' ) ) {
define( 'FS_METHOD', 'direct' );
}

// Load our recommended content block to force the non-iframe editor.
// Cypress fails to run correctly when the editor is iframed.
add_action(
'admin_init',
function() {
if ( function_exists( 'Classifai\Blocks\setup' ) ) {
Classifai\Blocks\setup();
}
}
);

0 comments on commit f85a352

Please sign in to comment.