forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Site Editor: fix template for page-on-front option (WordPress#66739)
Co-authored-by: ellatrix <[email protected]> Co-authored-by: draganescu <[email protected]> Co-authored-by: ntsekouras <[email protected]> Co-authored-by: mdawaffe <[email protected]>
- Loading branch information
1 parent
6cfeadc
commit e6ee784
Showing
2 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); | ||
|
||
test.describe( 'Template hierarchy', () => { | ||
test.beforeAll( async ( { requestUtils } ) => { | ||
await requestUtils.activateTheme( 'twentytwentyfour' ); | ||
} ); | ||
|
||
test.afterEach( async ( { requestUtils } ) => { | ||
await requestUtils.activateTheme( 'twentytwentyone' ); | ||
} ); | ||
|
||
test( 'shows correct template with page on front option', async ( { | ||
admin, | ||
page, | ||
editor, | ||
} ) => { | ||
await admin.visitAdminPage( 'options-reading.php' ); | ||
await page.click( 'input[name="show_on_front"][value="page"]' ); | ||
await page.selectOption( 'select[name="page_on_front"]', '2' ); | ||
await page.click( 'input[type="submit"]' ); | ||
await admin.visitSiteEditor(); | ||
|
||
// Title block should contain "Sample Page" | ||
await expect( | ||
editor.canvas.locator( 'role=document[name="Block: Title"]' ) | ||
).toContainText( 'Sample Page' ); | ||
|
||
await admin.visitAdminPage( 'options-reading.php' ); | ||
await page.click( 'input[name="show_on_front"][value="posts"]' ); | ||
await page.click( 'input[type="submit"]' ); | ||
} ); | ||
} ); |