Skip to content

Commit

Permalink
Test symbols and numbers in block bindings (#62410)
Browse files Browse the repository at this point in the history
  • Loading branch information
SantosGuillamot committed Jun 16, 2024
1 parent 70d3df4 commit aa6b6f0
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/e2e/specs/editor/various/block-bindings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1975,6 +1975,41 @@ test.describe( 'Block bindings', () => {
).toHaveText( 'new value' );
} );

// Related issue: https://github.com/WordPress/gutenberg/issues/62347
test( 'should be possible to use symbols and numbers as the custom field value', async ( {
editor,
} ) => {
await editor.insertBlock( {
name: 'core/paragraph',
attributes: {
anchor: 'paragraph-binding',
content: 'paragraph default content',
metadata: {
bindings: {
content: {
source: 'core/post-meta',
args: { key: 'text_custom_field' },
},
},
},
},
} );
const paragraphBlock = editor.canvas.getByRole( 'document', {
name: 'Block: Paragraph',
} );

await expect( paragraphBlock ).toHaveAttribute(
'contenteditable',
'true'
);
await paragraphBlock.fill( '$10.00' );
// Check the value of the custom field is being updated by visiting the frontend.
const previewPage = await editor.openPreviewPage();
await expect(
previewPage.locator( '#paragraph-binding' )
).toHaveText( '$10.00' );
} );

test( 'should be possible to edit the value of the url custom field from the button', async ( {
editor,
page,
Expand Down

0 comments on commit aa6b6f0

Please sign in to comment.