From d6e87a5d0499d044454d0e0c8d9e46376648c494 Mon Sep 17 00:00:00 2001 From: Hiroshi Urabe Date: Wed, 23 Jun 2021 09:37:14 +0900 Subject: [PATCH 1/4] Change to a theme that supports block-templates, and then delete wp_template and wp_template_part posts. --- .../specs/experiments/post-editor-template-mode.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js b/packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js index e28082d2d2157..16404af63416d 100644 --- a/packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js +++ b/packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js @@ -89,6 +89,7 @@ const createNewTemplate = async ( templateName ) => { describe( 'Post Editor Template mode', () => { beforeAll( async () => { + await activateTheme( 'tt1-blocks' ); await trashAllPosts( 'wp_template' ); await trashAllPosts( 'wp_template_part' ); } ); From 5a076eaa6626691134dd260158fc7a2d66a420bc Mon Sep 17 00:00:00 2001 From: Hiroshi Urabe Date: Wed, 23 Jun 2021 10:13:57 +0900 Subject: [PATCH 2/4] add plugin for switch add_theme_support('block-templates') --- packages/e2e-tests/plugins/block-templates.php | 17 +++++++++++++++++ .../post-editor-template-mode.test.js | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 packages/e2e-tests/plugins/block-templates.php diff --git a/packages/e2e-tests/plugins/block-templates.php b/packages/e2e-tests/plugins/block-templates.php new file mode 100644 index 0000000000000..e8321a1d74542 --- /dev/null +++ b/packages/e2e-tests/plugins/block-templates.php @@ -0,0 +1,17 @@ + { @@ -96,6 +98,7 @@ describe( 'Post Editor Template mode', () => { afterAll( async () => { await activateTheme( 'twentytwentyone' ); + await deactivatePlugin( 'gutenberg-test-block-templates' ); } ); it( 'Allow to switch to template mode, edit the template and check the result', async () => { @@ -143,6 +146,7 @@ describe( 'Post Editor Template mode', () => { } ); it( 'Allow creating custom block templates in classic themes', async () => { + await activatePlugin( 'gutenberg-test-block-templates' ); await activateTheme( 'twentytwentyone' ); await createNewPost(); // Create a random post. From 90634f6b8544b63487eae89c0270d39406951fa1 Mon Sep 17 00:00:00 2001 From: Hiroshi Urabe Date: Wed, 23 Jun 2021 17:23:33 +0900 Subject: [PATCH 3/4] Update packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Greg Ziółkowski --- .../specs/experiments/post-editor-template-mode.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js b/packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js index 23640087f6987..fa146cd1a9856 100644 --- a/packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js +++ b/packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js @@ -91,7 +91,7 @@ const createNewTemplate = async ( templateName ) => { describe( 'Post Editor Template mode', () => { beforeAll( async () => { - await activateTheme( 'tt1-blocks' ); + await activatePlugin( 'gutenberg-test-block-templates' ); await trashAllPosts( 'wp_template' ); await trashAllPosts( 'wp_template_part' ); } ); From 33660a482dfeb27b45c03a56604d6e33f83366da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Wed, 23 Jun 2021 11:45:40 +0200 Subject: [PATCH 4/4] Update packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js --- .../specs/experiments/post-editor-template-mode.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js b/packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js index fa146cd1a9856..5e8d80b1f45c5 100644 --- a/packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js +++ b/packages/e2e-tests/specs/experiments/post-editor-template-mode.test.js @@ -146,7 +146,6 @@ describe( 'Post Editor Template mode', () => { } ); it( 'Allow creating custom block templates in classic themes', async () => { - await activatePlugin( 'gutenberg-test-block-templates' ); await activateTheme( 'twentytwentyone' ); await createNewPost(); // Create a random post.