Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion packages/@react-aria/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"@testing-library/react": "^16.0.0",
"@testing-library/dom": "^10.1.0",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

kind of technically a breaking change, people will get installation errors and depending on their peer dependency setup, the new dependency may not install automatically

Copy link
Copy Markdown
Member Author

@LFDanLu LFDanLu Mar 9, 2026

Choose a reason for hiding this comment

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

good catch, I guess I'll keep both for now, will remove the /react one when we bump to full release

"@testing-library/user-event": "^14.0.0",
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
Expand Down
23 changes: 23 additions & 0 deletions packages/@react-aria/test-utils/src/act.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2025 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/

import * as React from 'react';
import * as ReactDOMTestUtils from 'react-dom/test-utils';

let actImpl: typeof ReactDOMTestUtils.act;
if (typeof React.act === 'function') {
actImpl = React.act;
} else {
actImpl = ReactDOMTestUtils.act;
}

export const act = actImpl;
3 changes: 2 additions & 1 deletion packages/@react-aria/test-utils/src/checkboxgroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
* governing permissions and limitations under the License.
*/

import {act, within} from '@testing-library/react';
import {act} from './act';
import {CheckboxGroupTesterOpts, UserOpts} from './types';
import {pressElement} from './events';
import {within} from '@testing-library/dom';

interface TriggerCheckboxOptions {
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/test-utils/src/combobox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* governing permissions and limitations under the License.
*/

import {act, waitFor, within} from '@testing-library/react';
import {act} from './act';
import {ComboBoxTesterOpts, UserOpts} from './types';
import {waitFor, within} from '@testing-library/dom';

interface ComboBoxOpenOpts {
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/test-utils/src/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* governing permissions and limitations under the License.
*/

import {act, waitFor, within} from '@testing-library/react';
import {act} from './act';
import {DialogTesterOpts, UserOpts} from './types';
import {waitFor, within} from '@testing-library/dom';

interface DialogOpenOpts {
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/test-utils/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
* governing permissions and limitations under the License.
*/

import {act, fireEvent} from '@testing-library/react';
import {act} from './act';
import {fireEvent} from '@testing-library/dom';
import {UserOpts} from './types';

export const DEFAULT_LONG_PRESS_TIME = 500;
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/test-utils/src/gridlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
* governing permissions and limitations under the License.
*/

import {act, within} from '@testing-library/react';
import {act} from './act';
import {getAltKey, getMetaKey, pressElement, triggerLongPress} from './events';
import {GridListTesterOpts, GridRowActionOpts, ToggleGridRowOpts, UserOpts} from './types';
import {within} from '@testing-library/dom';

interface GridListToggleRowOpts extends ToggleGridRowOpts {}
interface GridListRowActionOpts extends GridRowActionOpts {}
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/test-utils/src/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
* governing permissions and limitations under the License.
*/

import {act, within} from '@testing-library/react';
import {act} from './act';
import {getAltKey, getMetaKey, pressElement, triggerLongPress} from './events';
import {ListBoxTesterOpts, UserOpts} from './types';
import {within} from '@testing-library/dom';

interface ListBoxToggleOptionOpts {
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/test-utils/src/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
* governing permissions and limitations under the License.
*/

import {act, waitFor, within} from '@testing-library/react';
import {act} from './act';
import {MenuTesterOpts, UserOpts} from './types';
import {triggerLongPress} from './events';
import {waitFor, within} from '@testing-library/dom';

interface MenuOpenOpts {
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/test-utils/src/radiogroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
* governing permissions and limitations under the License.
*/

import {act, within} from '@testing-library/react';
import {act} from './act';
import {Direction, Orientation, RadioGroupTesterOpts, UserOpts} from './types';
import {pressElement} from './events';
import {within} from '@testing-library/dom';

interface TriggerRadioOptions {
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/test-utils/src/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* governing permissions and limitations under the License.
*/

import {act, waitFor, within} from '@testing-library/react';
import {act} from './act';
import {SelectTesterOpts, UserOpts} from './types';
import {waitFor, within} from '@testing-library/dom';

interface SelectOpenOpts {
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/test-utils/src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
* governing permissions and limitations under the License.
*/

import {act, waitFor, within} from '@testing-library/react';
import {act} from './act';
import {getAltKey, getMetaKey, pressElement, triggerLongPress} from './events';
import {GridRowActionOpts, TableTesterOpts, ToggleGridRowOpts, UserOpts} from './types';
import {waitFor, within} from '@testing-library/dom';

interface TableToggleRowOpts extends ToggleGridRowOpts {}
interface TableToggleSortOpts {
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/test-utils/src/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
* governing permissions and limitations under the License.
*/

import {act, within} from '@testing-library/react';
import {act} from './act';
import {Direction, Orientation, TabsTesterOpts, UserOpts} from './types';
import {pressElement} from './events';
import {within} from '@testing-library/dom';

interface TriggerTabOptions {
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/test-utils/src/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
* governing permissions and limitations under the License.
*/

import {act, within} from '@testing-library/react';
import {act} from './act';
import {BaseGridRowInteractionOpts, GridRowActionOpts, ToggleGridRowOpts, TreeTesterOpts, UserOpts} from './types';
import {getAltKey, getMetaKey, pressElement, triggerLongPress} from './events';
import {within} from '@testing-library/dom';

interface TreeToggleExpansionOpts extends BaseGridRowInteractionOpts {}
interface TreeToggleRowOpts extends ToggleGridRowOpts {}
Expand Down
1 change: 1 addition & 0 deletions packages/@react-spectrum/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"@testing-library/dom": "^10.1.0",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i imagine this one and the one above resulted in a lot of warnings when you run yarn install now about peers not being met?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah it was the contraints linter that prompted this

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hmmm i'm not sure why RAC's package.json isn't complaining about not having it as well, but I think maybe that'll just happen when we finally update yarn

"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.0.0",
"jest": "^29.5.0",
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6189,7 +6189,7 @@ __metadata:
dependencies:
"@swc/helpers": "npm:^0.5.0"
peerDependencies:
"@testing-library/react": ^16.0.0
"@testing-library/dom": ^10.1.0
"@testing-library/user-event": ^14.0.0
react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1
react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1
Expand Down Expand Up @@ -7808,6 +7808,7 @@ __metadata:
"@react-aria/test-utils": "npm:1.0.0-beta.2"
"@swc/helpers": "npm:^0.5.0"
peerDependencies:
"@testing-library/dom": ^10.1.0
"@testing-library/react": ^16.0.0
"@testing-library/user-event": ^14.0.0
jest: ^29.5.0
Expand Down