Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for upcoming changes in styles metadata in WordPress 5.9 #36327

Merged
merged 2 commits into from
Feb 24, 2022

Conversation

oandregal
Copy link
Member

See WordPress/wordpress-develop#1831

In that core PR, we're updating the metadata to "signal" the different kinds of styles the client may receive. It was globalStyles in WordPress 5.8 and it'll be theme or presets in WordPress 5.9. This PR makes Gutenberg work with any of those core versions.

How to test

Load the editor and verify that the styles look as expected for the following setups:

  • Using WordPress 5.8 and a theme with theme.json.
  • Using WordPress 5.9 and a theme with theme.json.

@oandregal oandregal self-assigned this Nov 8, 2021
@oandregal oandregal added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Nov 8, 2021
@aaronrobertshaw
Copy link
Contributor

This tests as advertised for me.

✅ Code changes LGTM. Types match the core PR.
✅ Block/site editors and styles look ok with 5.8
✅ Adjusting theme.json settings with 5.8 worked
✅ Block/site editors and styles look ok with 5.9
✅ Adjusting theme.json settings with 5.9 worked

I'd be inclined to approve this one however it might be good to get a second opinion first.

@oandregal oandregal force-pushed the update/types-coming-from-core branch 2 times, most recently from 74fa25e to 4888cb5 Compare November 15, 2021 19:10
@oandregal oandregal force-pushed the update/types-coming-from-core branch from 4888cb5 to a05a7a2 Compare November 29, 2021 12:09
Copy link
Member

@aristath aristath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, works as expected 👍

@oandregal oandregal force-pushed the update/types-coming-from-core branch from a05a7a2 to 262e33e Compare December 10, 2021 11:47
@oandregal
Copy link
Member Author

I see a few e2e test failures. They're related to multi-block selection specs/editor/various/multi-block-selection.test.js. I don't think they are related but would like to gain more understanding of them before merging (help welcome, I'm struggling to make progress here):

FAIL specs/editor/various/multi-block-selection.test.js (127.811 s)
  ● Multi-block selection › should return original focus after failed multi selection attempt

    expect(received).toMatchSnapshot()

    Snapshot name: `Multi-block selection should return original focus after failed multi selection attempt 1`

    - Snapshot  - 1
    + Received  + 1

      <!-- wp:paragraph -->
    - <p>2</p>
    + <p>12</p>
      <!-- /wp:paragraph -->

      506 | 		await page.keyboard.press( 'Backspace' );
      507 |
    > 508 | 		expect( await getEditedPostContent() ).toMatchSnapshot();
          | 		                                       ^
      509 | 	} );
      510 |
      511 | 	it( 'should preserve dragged selection on move', async () => {

      at Object.<anonymous> (specs/editor/various/multi-block-selection.test.js:508:42)
          at runMicrotasks (<anonymous>)

  ● Multi-block selection › should clear selection when clicking next to blocks

    Execution context was destroyed, most likely because of a navigation.

      555 |
      556 | 		// Wait for blocks to have updated asynchronously.
    > 557 | 		await page.evaluate( () => new Promise( window.requestIdleCallback ) );
          | 		^
      558 | 		await testNativeSelection();
      559 | 		expect( await getSelectedFlatIndices() ).toEqual( [] );
      560 |

      at rewriteError (../../node_modules/puppeteer-core/src/common/ExecutionContext.ts:322:15)
          at runMicrotasks (<anonymous>)
      at ExecutionContext._evaluateInternal (../../node_modules/puppeteer-core/src/common/ExecutionContext.ts:271:7)
      at ExecutionContext.evaluate (../../node_modules/puppeteer-core/src/common/ExecutionContext.ts:140:12)
      at Object.<anonymous> (specs/editor/various/multi-block-selection.test.js:557:3)

  ● Multi-block selection › should select all from empty selection

    Execution context was destroyed, most likely because of a navigation.

      at rewriteError (../../node_modules/puppeteer-core/src/common/ExecutionContext.ts:322:15)
          at runMicrotasks (<anonymous>)
      at ExecutionContext._evaluateInternal (../../node_modules/puppeteer-core/src/common/ExecutionContext.ts:271:7)
      at ExecutionContext.evaluate (../../node_modules/puppeteer-core/src/common/ExecutionContext.ts:140:12)
      at emulateSelectAll (../e2e-test-utils/build/@wordpress/e2e-test-utils/src/press-key-with-modifier.js:25:2)
      at pressKeyWithModifier (../e2e-test-utils/build/@wordpress/e2e-test-utils/src/press-key-with-modifier.js:145:10)
      at Object.<anonymous> (specs/editor/various/multi-block-selection.test.js:727:3)

@aristath aristath force-pushed the update/types-coming-from-core branch from 262e33e to c56bf45 Compare December 14, 2021 07:01
@aristath
Copy link
Member

aristath commented Dec 14, 2021

I see a few e2e test failures.

Yeah, I see the same... but they don't feel related. 🤔
I rebased the PR pulling the latest changes from trunk, let's see if that helps 👍


Update: The same tests fail after rebasing the PR so it has to be related to the changes here somehow

@oandregal oandregal force-pushed the update/types-coming-from-core branch 2 times, most recently from 4273e42 to cd13eb3 Compare December 16, 2021 12:04
@oandregal
Copy link
Member Author

Executing npm run test-e2e -- packages/e2e-tests/specs/editor/various/multi-block-selection.test.js locally gives me a different set of errors:

> gutenberg@12.2.0-rc.1 test-e2e /home/andre/src/gutenberg
> wp-scripts test-e2e --config packages/e2e-tests/jest.config.js "packages/e2e-tests/specs/editor/various/multi-block-selection.test.js"

Chromium is already in /home/andre/src/gutenberg/node_modules/puppeteer-core/.local-chromium/linux-901912; skipping download.
 FAIL  packages/e2e-tests/specs/editor/various/multi-block-selection.test.js (66.563 s)
  Multi-block selection
    ✓ should select with double ctrl+a and speak (2376 ms)
    ✓ should only trigger multi-selection when at the end (2145 ms)
    ✓ should use selection direction to determine vertical edge (2072 ms)
    ✓ should always expand single line selection (2011 ms)
    ✓ should allow selecting outer edge if there is no sibling block (1783 ms)
    ✓ should select and deselect with shift and arrow keys (2740 ms)
    ✕ should select with shift + click (2680 ms)
    ✓ should properly select a single block even if `shift` was held for the selection (3338 ms)
    ✕ should properly select multiple blocks if selected nested blocks belong to different parent (3662 ms)
    ✕ should properly select part of nested rich text block while holding shift (2810 ms)
    ✓ should select by dragging (2192 ms)
    ✕ should select by dragging into nested block (2874 ms)
    ✓ should cut and paste (2295 ms)
    ✓ should copy and paste (2122 ms)
    ✓ should return original focus after failed multi selection attempt (2023 ms)
    ✓ should preserve dragged selection on move (2043 ms)
    ✓ should clear selection when clicking next to blocks (1932 ms)
    ✓ should place the caret at the end of last pasted paragraph (paste to empty editor) (2580 ms)
    ✓ should place the caret at the end of last pasted paragraph (paste mid-block) (2756 ms)
    ✓ should place the caret at the end of last pasted paragraph (replace) (2498 ms)
    ✓ should set attributes for multiple paragraphs (2189 ms)
    ✓ should copy multiple blocks (2251 ms)
    ✓ should not multi select single block (1849 ms)
    ✕ should gradually multi-select (2858 ms)
    ✓ should multi-select from within the list block (2239 ms)
    ✓ should select all from empty selection (2054 ms)
    ✓ should select title if the cursor is on title (1961 ms)
    ○ skipped should deselect with Escape

  ● Multi-block selection › should select with shift + click

    expect(jest.fn()).not.toHaveWarned(expected)

    Expected mock function not to be called but it was called with:
    ["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"],["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"]

      at Object.assertExpectedCalls (../jest-console/build/@wordpress/jest-console/src/index.js:36:4)
          at runMicrotasks (<anonymous>)

  ● Multi-block selection › should properly select multiple blocks if selected nested blocks belong to different parent

    expect(jest.fn()).not.toHaveWarned(expected)

    Expected mock function not to be called but it was called with:
    ["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"],["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"],["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"],["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"],["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"],["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"]

      at Object.assertExpectedCalls (../jest-console/build/@wordpress/jest-console/src/index.js:36:4)
          at runMicrotasks (<anonymous>)

  ● Multi-block selection › should properly select part of nested rich text block while holding shift

    expect(jest.fn()).not.toHaveWarned(expected)

    Expected mock function not to be called but it was called with:
    ["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"],["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"],["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"]

      at Object.assertExpectedCalls (../jest-console/build/@wordpress/jest-console/src/index.js:36:4)
          at runMicrotasks (<anonymous>)

  ● Multi-block selection › should select by dragging into nested block

    expect(jest.fn()).not.toHaveWarned(expected)

    Expected mock function not to be called but it was called with:
    ["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"],["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"]

      at Object.assertExpectedCalls (../jest-console/build/@wordpress/jest-console/src/index.js:36:4)
          at runMicrotasks (<anonymous>)

  ● Multi-block selection › should gradually multi-select

    expect(jest.fn()).not.toHaveWarned(expected)

    Expected mock function not to be called but it was called with:
    ["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"],["Stylesheet  was not properly added.
    For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
    For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel=\"stylesheet\" href=\"http://localhost:8889/wp-admin/load-styles.php?c=0&amp;dir=ltr&amp;load%5Bchunk_0%5D=dashicons,admin-bar,buttons,media-views,editor-buttons,wp-components,wp-block-editor,wp-nux,wp-reusable-blocks,wp-editor,common,&amp;load%5Bchunk_1%5D=forms,wp-reset-editor-styles,wp-block-library,wp-editor-classic-layout-styles,wp-edit-blocks,wp-edit-post,wp-block-directory,wp-&amp;load%5Bchunk_2%5D=format-library,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets,site-icon,l10n,wp&amp;load%5Bchunk_3%5D=-auth-check,wp-block-library-theme&amp;ver=5.9-beta2-52351\" media=\"all\">"]

      at Object.assertExpectedCalls (../jest-console/build/@wordpress/jest-console/src/index.js:36:4)
          at runMicrotasks (<anonymous>)

Test Suites: 1 failed, 1 total
Tests:       5 failed, 1 skipped, 22 passed, 28 total
Snapshots:   25 passed, 25 total
Time:        66.625 s, estimated 73 s
Ran all test suites matching /packages\/e2e-tests\/specs\/editor\/various\/multi-block-selection.test.js/i.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gutenberg@12.2.0-rc.1 test-e2e: `wp-scripts test-e2e --config packages/e2e-tests/jest.config.js "packages/e2e-tests/specs/editor/various/multi-block-selection.test.js"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the gutenberg@12.2.0-rc.1 test-e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/andre/.npm/_logs/2021-12-16T12_08_02_377Z-debug.log

@ellatrix
Copy link
Member

As far as I can see, this change changes the styling (which seems unexpected?) so that there's no space between the canvas and the blocks. That's why some tests are failing.

should return original focus after failed multi selection attempt 2021-12-15T10-46-30

@ellatrix
Copy link
Member

It seems to me that theme styles are no longer loaded.

@oandregal
Copy link
Member Author

🤔 This is what I see when I run the tests in interactive mode (styles properly loaded):

Captura de ecrã de 2021-12-16 17-17-38

Captura de ecrã de 2021-12-16 17-22-33

@oandregal oandregal force-pushed the update/types-coming-from-core branch from af21791 to 67001f9 Compare February 10, 2022 12:50
@oandregal oandregal force-pushed the update/types-coming-from-core branch from 67001f9 to e22e9d7 Compare February 22, 2022 15:44
@oandregal oandregal force-pushed the update/types-coming-from-core branch from e22e9d7 to 12e4913 Compare February 24, 2022 12:28
@oandregal oandregal merged commit b828f5a into trunk Feb 24, 2022
@oandregal oandregal deleted the update/types-coming-from-core branch February 24, 2022 13:04
@github-actions github-actions bot added this to the Gutenberg 12.8 milestone Feb 24, 2022
oandregal added a commit that referenced this pull request Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants