mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Blocks: Align with Gutenberg the name of generated asset handle for core blocks
Related Gutenberg PR: https://github.com/WordPress/gutenberg/pull/25220. It aligns with the latest changes added by aristath to the Gutenberg project. As part of styles splitting for core blocks, there was a special pattern introduced for how style handles are named. Ideally, we would apply it to all blocks but there might be some backward compatibility considerations so I left the handling for non-core blocks unchanged. Props aristath. See #50328. git-svn-id: https://develop.svn.wordpress.org/trunk@49850 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -144,6 +144,30 @@ class WP_Test_Block_Register extends WP_UnitTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 50328
|
||||
*/
|
||||
function test_generate_block_asset_handle_core_block() {
|
||||
$block_name = 'core/paragraph';
|
||||
|
||||
$this->assertSame(
|
||||
'wp-block-paragraph-editor',
|
||||
generate_block_asset_handle( $block_name, 'editorScript' )
|
||||
);
|
||||
$this->assertSame(
|
||||
'wp-block-paragraph',
|
||||
generate_block_asset_handle( $block_name, 'script' )
|
||||
);
|
||||
$this->assertSame(
|
||||
'wp-block-paragraph-editor',
|
||||
generate_block_asset_handle( $block_name, 'editorStyle' )
|
||||
);
|
||||
$this->assertSame(
|
||||
'wp-block-paragraph',
|
||||
generate_block_asset_handle( $block_name, 'style' )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 50263
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user