Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/e2e-tests/plugins/block-templates.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* Plugin Name: Gutenberg Test Block Templates
* Plugin URI: https://github.com/WordPress/gutenberg
* Author: Gutenberg Team
*
* @package gutenberg-test-block-templates
*/

/**
* Activate Block Templates.
*/
function enqueue_block_templates() {
add_theme_support( 'block-templates' );
}

add_action( 'setup_theme', 'enqueue_block_templates' );
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
trashAllPosts,
openPreviewPage,
openDocumentSettingsSidebar,
activatePlugin,
deactivatePlugin,
} from '@wordpress/e2e-test-utils';

const openSidebarPanelWithTitle = async ( title ) => {
Expand Down Expand Up @@ -89,12 +91,14 @@ const createNewTemplate = async ( templateName ) => {

describe( 'Post Editor Template mode', () => {
beforeAll( async () => {
await activatePlugin( 'gutenberg-test-block-templates' );
await trashAllPosts( 'wp_template' );
await trashAllPosts( 'wp_template_part' );
} );

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 () => {
Expand Down