-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "useBlockSync: remove isControlled effect" (#61480)
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
- Loading branch information
1 parent
966f0a1
commit 2c2f899
Showing
2 changed files
with
69 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,42 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); | ||
|
||
test.describe( 'undo', () => { | ||
test.beforeAll( async ( { requestUtils } ) => { | ||
await requestUtils.activateTheme( 'emptytheme' ); | ||
} ); | ||
|
||
test.afterAll( async ( { requestUtils } ) => { | ||
await requestUtils.activateTheme( 'twentytwentyone' ); | ||
} ); | ||
|
||
test( 'does not empty header', async ( { admin, page, editor } ) => { | ||
await admin.visitSiteEditor( { canvas: 'edit' } ); | ||
|
||
// Check if there's a valid child block with a type (not appender). | ||
await expect( | ||
editor.canvas.locator( | ||
'[data-type="core/template-part"] [data-type]' | ||
) | ||
).not.toHaveCount( 0 ); | ||
|
||
// insert a block | ||
await editor.insertBlock( { name: 'core/paragraph' } ); | ||
|
||
// undo | ||
await page | ||
.getByRole( 'button', { | ||
name: 'Undo', | ||
} ) | ||
.click(); | ||
|
||
// Check if there's a valid child block with a type (not appender). | ||
await expect( | ||
editor.canvas.locator( | ||
'[data-type="core/template-part"] [data-type]' | ||
) | ||
).not.toHaveCount( 0 ); | ||
} ); | ||
} ); |