Skip to content

Commit

Permalink
Update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SantosGuillamot committed Oct 3, 2024
1 parent e9e00d4 commit 303381c
Showing 1 changed file with 26 additions and 34 deletions.
60 changes: 26 additions & 34 deletions test/e2e/specs/editor/various/block-bindings/post-meta.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,29 +144,25 @@ test.describe( 'Post Meta source', () => {
editor,
page,
} ) => {
/**
* Create connection manually until this issue is solved:
* https://github.com/WordPress/gutenberg/pull/65604
*
* Once solved, block with the binding can be directly inserted.
*/
await editor.insertBlock( {
name: 'core/paragraph',
attributes: {
content: 'fallback content',
metadata: {
bindings: {
content: {
source: 'core/post-meta',
args: {
key: 'movie_field',
},
},
},
},
},
} );
await page.getByLabel( 'Attributes options' ).click();
await page
.getByRole( 'menuitemcheckbox', {
name: 'Show content',
} )
.click();
const contentBinding = page.getByRole( 'button', {
name: 'content',
} );
await contentBinding.click();
await page
.getByRole( 'menuitemradio' )
.filter( { hasText: 'Movie field label' } )
.click();
await expect( contentBinding ).toContainText(
'Movie field label'
);
Expand All @@ -175,29 +171,25 @@ test.describe( 'Post Meta source', () => {
editor,
page,
} ) => {
/**
* Create connection manually until this issue is solved:
* https://github.com/WordPress/gutenberg/pull/65604
*
* Once solved, block with the binding can be directly inserted.
*/
await editor.insertBlock( {
name: 'core/paragraph',
attributes: {
content: 'fallback content',
metadata: {
bindings: {
content: {
source: 'core/post-meta',
args: {
key: 'field_without_label_or_default',
},
},
},
},
},
} );
await page.getByLabel( 'Attributes options' ).click();
await page
.getByRole( 'menuitemcheckbox', {
name: 'Show content',
} )
.click();
const contentBinding = page.getByRole( 'button', {
name: 'content',
} );
await contentBinding.click();
await page
.getByRole( 'menuitemradio' )
.filter( { hasText: 'field_without_label_or_default' } )
.click();
await expect( contentBinding ).toContainText(
'field_without_label_or_default'
);
Expand Down

0 comments on commit 303381c

Please sign in to comment.