From 3f17d87957b0e4ba51f4bd29b6c61da20c52fa34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Wed, 21 Sep 2022 10:05:38 +0300 Subject: [PATCH 1/2] Pullquote: fix transform to quote crash --- packages/block-library/src/quote/transforms.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/quote/transforms.js b/packages/block-library/src/quote/transforms.js index 8ccc4ac01b899d..f8977bd9974928 100644 --- a/packages/block-library/src/quote/transforms.js +++ b/packages/block-library/src/quote/transforms.js @@ -17,7 +17,7 @@ const transforms = { fontSize, style, }, - createBlock( 'core/paragraph', { content: value } ) + [ createBlock( 'core/paragraph', { content: value } ) ] ); }, }, From 390e3be71ef0c8e96bfdffc6b7905d9aa6bd6302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Wed, 21 Sep 2022 11:47:58 +0300 Subject: [PATCH 2/2] Add pullquote transform e2e test --- .../specs/editor/blocks/pullquote.test.js | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 packages/e2e-tests/specs/editor/blocks/pullquote.test.js diff --git a/packages/e2e-tests/specs/editor/blocks/pullquote.test.js b/packages/e2e-tests/specs/editor/blocks/pullquote.test.js new file mode 100644 index 00000000000000..9c9b9f4513fae6 --- /dev/null +++ b/packages/e2e-tests/specs/editor/blocks/pullquote.test.js @@ -0,0 +1,47 @@ +/** + * WordPress dependencies + */ +import { + clickBlockAppender, + getEditedPostContent, + createNewPost, + transformBlockTo, +} from '@wordpress/e2e-test-utils'; + +describe( 'Quote', () => { + beforeEach( async () => { + await createNewPost(); + } ); + + it( 'can be created by converting a quote and converted back to quote', async () => { + await clickBlockAppender(); + await page.keyboard.type( 'test' ); + await transformBlockTo( 'Quote' ); + + expect( await getEditedPostContent() ).toMatchInlineSnapshot( ` + " +
+

test

+
+ " + ` ); + + await transformBlockTo( 'Pullquote' ); + + expect( await getEditedPostContent() ).toMatchInlineSnapshot( ` + " +

test

+ " + ` ); + + await transformBlockTo( 'Quote' ); + + expect( await getEditedPostContent() ).toMatchInlineSnapshot( ` + " +
+

test

+
+ " + ` ); + } ); +} );