Skip to content

Commit

Permalink
Patterns: Change deprecated social icons for standard in e2e (WordPre…
Browse files Browse the repository at this point in the history
…ss#65312)

* Change deprecated social icons for standard

* Update more tests

* Update test/e2e/specs/editor/various/adding-patterns.spec.js

Co-authored-by: Kai Hao <kevin830726@gmail.com>

* One more spec

* Update snapshots

* Revert changes to post-editor.spec.js

---------

Co-authored-by: cbravobernal <cbravobernal@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: kevin940726 <kevin940726@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
  • Loading branch information
5 people authored Sep 13, 2024
1 parent 33e2fad commit dfc28b0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@
<p>Dummy text</p>
<!-- /wp:paragraph -->

<!-- wp:social-links {"customIconColor":"#ffffff","iconColorValue":"#ffffff","customIconBackgroundColor":"#3962e3","iconBackgroundColorValue":"#3962e3","metadata":{"categories":["call-to-action"],"patternName":"core/social-links-shared-background-color","name":"Social links with a shared background color"},"className":"has-icon-color"} -->
<ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:query {"queryId":1,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"metadata":{"categories":["posts"],"patternName":"core/query-standard-posts","name":"Standard"}} -->
<div class="wp-block-query"><!-- wp:post-template -->
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:social-link {"url":"#","service":"chain"} /-->
<!-- wp:post-featured-image {"isLink":true,"align":"wide"} /-->

<!-- wp:social-link {"url":"#","service":"mail"} /--></ul>
<!-- /wp:social-links -->
<!-- wp:post-excerpt /-->

<!-- wp:separator {"opacity":"css"} -->
<hr class="wp-block-separator has-css-opacity"/>
<!-- /wp:separator -->

<!-- wp:post-date /-->
<!-- /wp:post-template --></div>
<!-- /wp:query -->
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@
<p>Dummy text</p>
<!-- /wp:paragraph -->

<!-- wp:social-links {"customIconColor":"#ffffff","iconColorValue":"#ffffff","customIconBackgroundColor":"#3962e3","iconBackgroundColorValue":"#3962e3","metadata":{"categories":["call-to-action"],"patternName":"core/social-links-shared-background-color","name":"Social links with a shared background color"},"className":"has-icon-color"} -->
<ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:query {"queryId":1,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"metadata":{"categories":["posts"],"patternName":"core/query-standard-posts","name":"Standard"}} -->
<div class="wp-block-query"><!-- wp:post-template -->
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:social-link {"url":"#","service":"chain"} /-->
<!-- wp:post-featured-image {"isLink":true,"align":"wide"} /-->

<!-- wp:social-link {"url":"#","service":"mail"} /--></ul>
<!-- /wp:social-links -->
<!-- wp:post-excerpt /-->

<!-- wp:separator {"opacity":"css"} -->
<hr class="wp-block-separator has-css-opacity"/>
<!-- /wp:separator -->

<!-- wp:post-date /-->
<!-- /wp:post-template --></div>
<!-- /wp:query -->
8 changes: 3 additions & 5 deletions test/e2e/specs/editor/various/adding-patterns.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ test.describe( 'adding patterns', () => {
await page.getByRole( 'tab', { name: 'Patterns' } ).click();
await page.fill(
'role=region[name="Block Library"i] >> role=searchbox[name="Search for blocks and patterns"i]',
'Social links with a shared background color'
'Standard'
);

await page.click(
'role=option[name="Social links with a shared background color"i]'
);
await page.getByRole( 'option', { name: 'Standard' } ).click();
await expect.poll( editor.getBlocks ).toMatchObject( [
{
name: 'core/social-links',
name: 'core/query',
},
] );
} );
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/various/inserting-blocks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ test.describe( 'Inserting blocks (@firefox, @webkit)', () => {
'role=region[name="Editor top bar"i] >> role=button[name="Toggle block inserter"i]'
);

const PATTERN_NAME = 'Social links with a shared background color';
const PATTERN_NAME = 'Standard';

await page.fill(
'role=region[name="Block Library"i] >> role=searchbox[name="Search for blocks and patterns"i]',
Expand Down Expand Up @@ -350,7 +350,7 @@ test.describe( 'Inserting blocks (@firefox, @webkit)', () => {
'role=region[name="Editor top bar"i] >> role=button[name="Toggle block inserter"i]'
);

const PATTERN_NAME = 'Social links with a shared background color';
const PATTERN_NAME = 'Standard';

await page.fill(
'role=region[name="Block Library"i] >> role=searchbox[name="Search for blocks and patterns"i]',
Expand Down

0 comments on commit dfc28b0

Please sign in to comment.