Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 33 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
"@inquirer/prompts": "7.2.0",
"@octokit/rest": "16.26.0",
"@playwright/test": "1.57.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "14.3.0",
"@testing-library/user-event": "14.4.3",
"@testing-library/jest-dom": "6.9.1",
"@testing-library/react": "16.3.2",
"@testing-library/user-event": "14.6.1",
"@types/node": "^20.17.10",
"@types/prettier": "2.4.4",
"@types/react": "^18.3.27",
Expand Down
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Expose `useDrag` from `@use-gesture/react` package via private API's ([#66735](https://github.com/WordPress/gutenberg/pull/66735)).
- `Disabled`, `Modal`, `Popover`, `Tooltip`: Move context code to separate files to help docgen prop extraction ([#75316](https://github.com/WordPress/gutenberg/pull/75316)).
- Update Emotion dependencies to ensure compatibility with React 19 ([#75324](https://github.com/WordPress/gutenberg/pull/75324)).
- Update Testing Library packages used in unit tests ([#75340](https://github.com/WordPress/gutenberg/pull/75340)).

## 32.1.0 (2026-01-29)

Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"@ariakit/test": "^0.4.7",
"@storybook/addon-docs": "^10.1.11",
"@storybook/react-vite": "^10.1.11",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/jest-dom": "^6.9.1",
"@types/jest": "^29.5.14",
"@wordpress/jest-console": "file:../jest-console",
"snapshot-diff": "^0.10.0",
Expand Down
9 changes: 5 additions & 4 deletions packages/components/src/radio-control/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ describe.each( [
name: defaultProps.options[ 1 ].label,
} )
).toHaveFocus();
expect( onChangeSpy ).toHaveBeenCalledTimes( 2 );

expect( onChangeSpy ).toHaveBeenCalledTimes( 1 );
expect( onChangeSpy ).toHaveBeenLastCalledWith(
defaultProps.options[ 1 ].value
);
Expand All @@ -253,8 +254,8 @@ describe.each( [
name: defaultProps.options[ 0 ].label,
} )
).toHaveFocus();
// TODO: why called twice for every interaction?
expect( onChangeSpy ).toHaveBeenCalledTimes( 6 );

expect( onChangeSpy ).toHaveBeenCalledTimes( 3 );
expect( onChangeSpy ).toHaveBeenLastCalledWith(
defaultProps.options[ 0 ].value
);
Expand All @@ -268,7 +269,7 @@ describe.each( [
} )
).toHaveFocus();

expect( onChangeSpy ).toHaveBeenCalledTimes( 8 );
expect( onChangeSpy ).toHaveBeenCalledTimes( 4 );
expect( onChangeSpy ).toHaveBeenLastCalledWith(
defaultProps.options[ 2 ].value
);
Expand Down
1 change: 1 addition & 0 deletions packages/dataviews/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
### Internal

- DataForm: Use public `ColorPicker` component instead of internal `Picker` in color control. [#75394](https://github.com/WordPress/gutenberg/pull/75394)
- Update Testing Library packages used in unit tests ([#75340](https://github.com/WordPress/gutenberg/pull/75340))

## 11.3.0 (2026-01-29)

Expand Down
2 changes: 1 addition & 1 deletion packages/dataviews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"devDependencies": {
"@storybook/addon-docs": "^10.1.11",
"@storybook/react-vite": "^10.1.11",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/jest-dom": "^6.9.1",
"@types/jest": "^29.5.14",
"esbuild": "^0.27.2",
"storybook": "^10.1.11"
Expand Down
2 changes: 1 addition & 1 deletion packages/global-styles-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"memize": "^2.1.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/jest-dom": "^6.9.1",
"@types/jest": "^29.5.14"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"jest-mock": "^29.6.2"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/jest-dom": "^6.9.1",
"@types/jest": "^29.5.14"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/media-fields/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"clsx": "2.1.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/jest-dom": "^6.9.1",
"@types/jest": "^29.5.14"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@terrazzo/cli": "^0.10.2",
"@terrazzo/plugin-css": "^0.10.2",
"@terrazzo/token-tools": "^0.10.2",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/jest-dom": "^6.9.1",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.10",
"esbuild": "^0.27.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"devDependencies": {
"@storybook/addon-docs": "^10.1.11",
"@storybook/react-vite": "^10.1.11",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/jest-dom": "^6.9.1",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.10",
"storybook": "^10.1.11"
Expand Down
36 changes: 36 additions & 0 deletions test/unit/config/global-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,39 @@ if ( ! global.TextEncoder ) {
// Override jsdom built-ins with native node implementation.
global.Blob = BlobPolyfill;
global.File = FilePolyfill;

/**
* Mock `userEvent.setup()` to fix the `HTMLElement.prototype` properties
* that `@testing-library/user-event` makes non-writable, which breaks
* `@ariakit/test` and other code that tries to override `focus` and `blur`.
* @see https://github.com/testing-library/user-event/pull/1265
*/
jest.mock( '@testing-library/user-event', () => {
const actual = jest.requireActual( '@testing-library/user-event' );
const patchedUserEvent = {
...actual.userEvent,
setup( ...args ) {
const user = actual.userEvent.setup( ...args );
const { focus, blur } = global.HTMLElement.prototype;
Object.defineProperties( global.HTMLElement.prototype, {
focus: {
configurable: true,
value: focus,
writable: true,
},
blur: {
configurable: true,
value: blur,
writable: true,
},
} );
return user;
},
};
return {
...actual,
userEvent: patchedUserEvent,
default: patchedUserEvent,
__esModule: true,
};
} );
Loading