Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: BlockList uses Hooks (#50293)
* refactor: BlockList EmptyList uses Hooks Adopt modern React paradigms prior to refactoring the components composition. Completed to more closely mirror other code in the code base. * refactor: BlockList uses Hooks Adopt modern React paradigms prior to refactoring the components composition. Completed to more closely mirror other code in the code base. * refactor: BlockList higher-order components use Hooks Adopt modern React paradigms prior to refactoring the components composition. Completed to more closely mirror other code in the code base. Additionally, this removes the `withPreferredColorScheme` higher-order component as it appeared unused. * fix: BlockList footer interactivity `VirtualList` expects a React Component (e.g. `SomeComponent`), or a React element (e.g. `<SomeComponent` />) passed to the `ListFooterComponent` prop. Passing a function instead resulted in the block inserter never opening when tapping the block appender button within the footer; this appeared to be due to excessive re-renders resetting the `isOpen` state for the inserter. * fix: Rename Footer addBlockToEndOfPost callback prop The typo led to an undefined callback function. * fix: Reinstate missing prop used within store selector This prop was originally accessed via the `withSelect` higher-order component. When converting to Hooks, passing this prop was overlooked. * fix: Scope timer run by `waitForStoreResolvers` Running all timers could create testing failures in scenarios wheres where inner blocks were inserted, e.g. Social Icons. It is not known why, but scoping from "all" to "pending" timers resolved the following errors, without breaking any existing tests. Unknown origin: ``` Warning: You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ``` Originating from `waitForStoreResolvers`: ``` Ran 100000 timers, and there are still more! Assuming we've hit an infinite recursion and bailing out... ``` Originating from `packages/block-editor/src/components/block-list/test/index.native.js`: ``` thrown: "Exceeded timeout of 5000 ms for a test. ``` * test: BlockList renders footer appender * typo: Add code comment Added to align with sibling tests. * test: Expand empty BlockList appender tests
- Loading branch information
023631c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flaky tests detected in 023631c.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.
🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4916347031
📝 Reported issues:
/test/e2e/specs/site-editor/user-global-styles-revisions.spec.js
/test/e2e/specs/site-editor/user-global-styles-revisions.spec.js