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

Update @ariakit/react to v0.3.12 and @ariakit/test to v0.3.7 #57547

Merged
merged 6 commits into from
Jan 10, 2024
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
152 changes: 69 additions & 83 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"devDependencies": {
"@actions/core": "1.9.1",
"@actions/github": "5.0.0",
"@ariakit/test": "^0.3.5",
"@ariakit/test": "^0.3.7",
"@babel/core": "7.16.0",
"@babel/plugin-proposal-export-namespace-from": "7.18.9",
"@babel/plugin-syntax-jsx": "7.16.0",
Expand Down
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
### Enhancements

- Update `ariakit` to version `0.3.10` ([#57325](https://github.com/WordPress/gutenberg/pull/57325)).
- Update `@ariakit/react` to version `0.3.12` and @ariakit/test to version `0.3.7` ([#57547](https://github.com/WordPress/gutenberg/pull/57547)).
- `DropdownMenuV2`: do not collapse suffix width ([#57238](https://github.com/WordPress/gutenberg/pull/57238)).
- `DateTimePicker`: Adjustment of the dot position on DayButton and expansion of the button area. ([#55502](https://github.com/WordPress/gutenberg/pull/55502)).
- `Modal`: Improve application of body class names ([#55430](https://github.com/WordPress/gutenberg/pull/55430)).
Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],
"types": "build-types",
"dependencies": {
"@ariakit/react": "^0.3.10",
"@ariakit/react": "^0.3.12",
"@babel/runtime": "^7.16.0",
"@emotion/cache": "^11.7.1",
"@emotion/css": "^11.7.1",
Expand Down
26 changes: 10 additions & 16 deletions packages/components/src/alignment-matrix-control/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { render, screen, waitFor, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { press, click } from '@ariakit/test';

/**
* Internal dependencies
Expand Down Expand Up @@ -37,11 +37,9 @@ describe( 'AlignmentMatrixControl', () => {
} );

it( 'should be centered by default', async () => {
const user = userEvent.setup();

await renderAndInitCompositeStore( <AlignmentMatrixControl /> );

await user.tab();
await press.Tab();

expect( getCell( 'center center' ) ).toHaveFocus();
} );
Expand All @@ -60,7 +58,6 @@ describe( 'AlignmentMatrixControl', () => {
'bottom center',
'bottom right',
] )( '%s', async ( alignment ) => {
const user = userEvent.setup();
const spy = jest.fn();

await renderAndInitCompositeStore(
Expand All @@ -72,14 +69,13 @@ describe( 'AlignmentMatrixControl', () => {

const cell = getCell( alignment );

await user.click( cell );
await click( cell );

expect( cell ).toHaveFocus();
expect( spy ).toHaveBeenCalledWith( alignment );
} );

it( 'unless already focused', async () => {
const user = userEvent.setup();
const spy = jest.fn();

await renderAndInitCompositeStore(
Expand All @@ -91,7 +87,7 @@ describe( 'AlignmentMatrixControl', () => {

const cell = getCell( 'center center' );

await user.click( cell );
await click( cell );

expect( cell ).toHaveFocus();
expect( spy ).not.toHaveBeenCalled();
Expand All @@ -106,16 +102,15 @@ describe( 'AlignmentMatrixControl', () => {
[ 'ArrowLeft', 'center left' ],
[ 'ArrowDown', 'bottom center' ],
[ 'ArrowRight', 'center right' ],
] )( '%s', async ( keyRef, cellRef ) => {
const user = userEvent.setup();
] as const )( '%s', async ( keyRef, cellRef ) => {
const spy = jest.fn();

await renderAndInitCompositeStore(
<AlignmentMatrixControl onChange={ spy } />
);

await user.tab();
await user.keyboard( `[${ keyRef }]` );
await press.Tab();
await press[ keyRef ]();

expect( getCell( cellRef ) ).toHaveFocus();
expect( spy ).toHaveBeenCalledWith( cellRef );
Expand All @@ -128,17 +123,16 @@ describe( 'AlignmentMatrixControl', () => {
[ 'ArrowLeft', 'top left' ],
[ 'ArrowDown', 'bottom right' ],
[ 'ArrowRight', 'bottom right' ],
] )( '%s', async ( keyRef, cellRef ) => {
const user = userEvent.setup();
] as const )( '%s', async ( keyRef, cellRef ) => {
const spy = jest.fn();

await renderAndInitCompositeStore(
<AlignmentMatrixControl onChange={ spy } />
);

const cell = getCell( cellRef );
await user.click( cell );
await user.keyboard( `[${ keyRef }]` );
await click( cell );
await press[ keyRef ]();

expect( cell ).toHaveFocus();
expect( spy ).toHaveBeenCalledWith( cellRef );
Expand Down
Loading
Loading