Skip to content

Commit 6017b5a

Browse files
authored
Testing: Add e2e tests for relaxed default block paste behavior (#73963)
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
1 parent b59a245 commit 6017b5a

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

test/e2e/specs/editor/various/copy-cut-paste.spec.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,4 +792,39 @@ test.describe( 'Copy/cut/paste', () => {
792792
},
793793
] );
794794
} );
795+
796+
test( 'should replace the default block on paste when the content is unmodified', async ( {
797+
editor,
798+
pageUtils,
799+
} ) => {
800+
await editor.insertBlock( {
801+
name: 'core/heading',
802+
attributes: {
803+
content: 'AB',
804+
},
805+
} );
806+
await pageUtils.pressKeys( 'primary+c' );
807+
await editor.insertBlock( {
808+
name: 'core/paragraph',
809+
attributes: { metadata: { name: 'Test' } },
810+
} );
811+
await pageUtils.pressKeys( 'primary+v' );
812+
813+
expect( await editor.getBlocks() ).toMatchObject( [
814+
{
815+
name: 'core/heading',
816+
attributes: {
817+
content: 'AB',
818+
level: 2,
819+
},
820+
},
821+
{
822+
name: 'core/heading',
823+
attributes: {
824+
content: 'AB',
825+
level: 2,
826+
},
827+
},
828+
] );
829+
} );
795830
} );

0 commit comments

Comments
 (0)