mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 10:44:26 +00:00
Build: Split packages and blocks to their webpack configs.
This also adds support for the viewScript for blocks fixing the PDF preview for file blocks. Props desrosj, gziolo. See #53397. git-svn-id: https://develop.svn.wordpress.org/trunk@51259 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
},
|
||||
"editorScript": "tests-notice-editor-script",
|
||||
"script": "tests-notice-script",
|
||||
"viewScript": "tests-notice-view-script",
|
||||
"editorStyle": "tests-notice-editor-style",
|
||||
"style": "tests-notice-style"
|
||||
}
|
||||
|
||||
@@ -132,6 +132,10 @@ class WP_Test_Block_Register extends WP_UnitTestCase {
|
||||
'unit-tests-my-block-script',
|
||||
generate_block_asset_handle( $block_name, 'script' )
|
||||
);
|
||||
$this->assertSame(
|
||||
'unit-tests-my-block-view-script',
|
||||
generate_block_asset_handle( $block_name, 'viewScript' )
|
||||
);
|
||||
$this->assertSame(
|
||||
'unit-tests-my-block-editor-style',
|
||||
generate_block_asset_handle( $block_name, 'editorStyle' )
|
||||
@@ -156,6 +160,10 @@ class WP_Test_Block_Register extends WP_UnitTestCase {
|
||||
'wp-block-paragraph',
|
||||
generate_block_asset_handle( $block_name, 'script' )
|
||||
);
|
||||
$this->assertSame(
|
||||
'wp-block-paragraph-view',
|
||||
generate_block_asset_handle( $block_name, 'viewScript' )
|
||||
);
|
||||
$this->assertSame(
|
||||
'wp-block-paragraph-editor',
|
||||
generate_block_asset_handle( $block_name, 'editorStyle' )
|
||||
@@ -372,6 +380,7 @@ class WP_Test_Block_Register extends WP_UnitTestCase {
|
||||
);
|
||||
$this->assertSame( 'tests-notice-editor-script', $result->editor_script );
|
||||
$this->assertSame( 'tests-notice-script', $result->script );
|
||||
$this->assertSame( 'tests-notice-view-script', $result->view_script );
|
||||
$this->assertSame( 'tests-notice-editor-style', $result->editor_style );
|
||||
$this->assertSame( 'tests-notice-style', $result->style );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user