Skip to content

Commit

Permalink
Cover: Fix integration tests for ResizableBox via BlockPopover (#49497)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw authored Mar 31, 2023
1 parent f2eb422 commit 195c68e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/unit/config/global-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ if ( ! window.wp?.galleryBlockV2Enabled ) {
}

global.ResizeObserver = require( 'resize-observer-polyfill' );

/**
* The following mock is for block integration tests that might render
* components leveraging DOMRect. For example, the Cover block which now renders
* its ResizableBox control via the BlockPopover component.
*/
if ( ! window.DOMRect ) {
window.DOMRect = class DOMRect {};
}

1 comment on commit 195c68e

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 195c68e.
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/4571857808
📝 Reported issues:

Please sign in to comment.