Skip to content

Commit 1273fea

Browse files
committed
review comments
1 parent 7c5ed5c commit 1273fea

File tree

4 files changed

+6
-33
lines changed

4 files changed

+6
-33
lines changed

packages/@react-aria/test-utils/src/combobox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class ComboBoxTester {
119119
}
120120

121121
/**
122-
* Returns a option matching the specified index or text content.
122+
* Returns an option matching the specified index or text content.
123123
*/
124124
findOption(opts: {optionIndexOrText: number | string}): HTMLElement {
125125
let {

packages/@react-spectrum/picker/test/Picker.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,7 @@ describe('Picker', function () {
10851085
expect(picker).toHaveTextContent('Two');
10861086
});
10871087

1088-
// TODO: re-enable after merge
1089-
it.skip('can select items with the Enter key', async function () {
1088+
it('can select items with the Enter key', async function () {
10901089
let {getByRole} = render(
10911090
<Provider theme={theme}>
10921091
<Picker label="Test" onSelectionChange={onSelectionChange}>

packages/dev/docs/pages/react-aria/testing.mdx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ for each aria pattern and how they can be used to simulate common user interacti
2929
## Introduction
3030

3131
Running automated tests on your application helps ensure that it continues to work as expected over time.
32-
You can use testing tools like [Enzyme](https://enzymejs.github.io/enzyme/) or
33-
[React Testing Library](https://testing-library.com/docs/react-testing-library/intro) along with test runners like
32+
You can use testing tools like [React Testing Library](https://testing-library.com/docs/react-testing-library/intro) along with test runners like
3433
[Jest](https://jestjs.io) or [Mocha](https://mochajs.org) to test applications built with React Aria Components or hooks. These generally
3534
work quite well out of the box but there are a few things to consider to ensure your tests are the best they
3635
can be.
@@ -67,18 +66,6 @@ let tree = render(<MyComponent />);
6766
let option = tree.getByRole('button');
6867
```
6968

70-
### Enzyme
71-
72-
In Enzyme, you can [use CSS selectors](https://enzymejs.github.io/enzyme/docs/api/ReactWrapper/find.html) to find
73-
elements. You can query by role using an attribute selector:
74-
75-
```tsx
76-
import {mount} from 'enzyme';
77-
78-
let wrapper = mount(<MyComponent />);
79-
let option = wrapper.find('[role="option"]');
80-
```
81-
8269
## Test ids
8370

8471
Querying by semantics covers many scenarios, but what if you have many buttons on a page? How do you find the specific button
@@ -92,7 +79,7 @@ through to their underlying DOM nodes, which allows you to use an attribute like
9279
a particular instance of a component. For example, you could add test ids to the two input elements
9380
in a login form and use them to find the username and password fields.
9481

95-
This example uses React Testing Library, but the idea could be applied in a similar way with Enzyme or other
82+
This example uses React Testing Library, but the idea could be applied in a similar way with other
9683
testing libraries.
9784

9885
```tsx

packages/dev/docs/pages/react-spectrum/testing.mdx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ query the DOM tree for elements and simulate user interactions.
2424
## Introduction
2525

2626
Running automated tests on your application helps ensure that it continues to work as expected over time.
27-
You can use testing tools like [Enzyme](https://enzymejs.github.io/enzyme/) or
28-
[React Testing Library](https://testing-library.com/docs/react-testing-library/intro) along with test runners like
27+
You can use testing tools like [React Testing Library](https://testing-library.com/docs/react-testing-library/intro) along with test runners like
2928
[Jest](https://jestjs.io) or [Mocha](https://mochajs.org) to test React Spectrum applications. These generally
3029
work quite well out of the box but there are a few things to consider to ensure your tests are the best they
3130
can be.
@@ -72,18 +71,6 @@ let tree = render(<MyComponent />);
7271
let option = tree.getByRole('button');
7372
```
7473

75-
### Enzyme
76-
77-
In Enzyme, you can [use CSS selectors](https://enzymejs.github.io/enzyme/docs/api/ReactWrapper/find.html) to find
78-
elements. You can query by role using an attribute selector:
79-
80-
```tsx
81-
import {mount} from 'enzyme';
82-
83-
let wrapper = mount(<MyComponent />);
84-
let option = wrapper.find('[role="option"]');
85-
```
86-
8774
## Test ids
8875

8976
Querying by semantics covers many scenarios, but what if you have many buttons on a page? How do you find the specific button
@@ -97,7 +84,7 @@ through to their underlying DOM nodes, which allows you to use an attribute like
9784
a particular instance of a component. For example, you could add test ids to the two input elements
9885
in a login form and use them to find the username and password fields.
9986

100-
This example uses React Testing Library, but the idea could be applied in a similar way with Enzyme or other
87+
This example uses React Testing Library, but the idea could be applied in a similar way with other
10188
testing libraries.
10289

10390
```tsx

0 commit comments

Comments
 (0)