Skip to content

Commit ade3851

Browse files
authored
fix: prevent v-docs build from throwing due to import (#9284)
1 parent 5c8217a commit ade3851

File tree

8 files changed

+0
-251
lines changed

8 files changed

+0
-251
lines changed

packages/@react-spectrum/checkbox/docs/CheckboxGroup.mdx

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {Layout} from '@react-spectrum/docs';
1111
export default Layout;
1212

1313
import docs from 'docs:@react-spectrum/checkbox';
14-
import checkboxgroupUtil from 'docs:@react-aria/test-utils/src/checkboxgroup.ts';
1514
import packageData from '@react-spectrum/checkbox/package.json';
1615
import {HeaderInfo, PropTable, PageDescription, VersionBadge, ClassAPI} from '@react-spectrum/docs';
1716

@@ -333,43 +332,3 @@ See the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/
333332
<Checkbox value="basketball">Basketball</Checkbox>
334333
</CheckboxGroup>
335334
```
336-
337-
## Testing
338-
339-
### Test utils <VersionBadge version="beta" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
340-
341-
`@react-spectrum/test-utils` offers common checkbox group interaction utilities which you may find helpful when writing tests. See [here](./testing.html#react-spectrum-test-utils) for more information on how to setup these utilities
342-
in your tests. Below is the full definition of the checkbox group tester and a sample of how you could use it in your test suite.
343-
344-
```ts
345-
// CheckboxGroup.test.ts
346-
import {render} from '@testing-library/react';
347-
import {theme} from '@react-spectrum/theme-default';
348-
import {User} from '@react-spectrum/test-utils';
349-
350-
let testUtilUser = new User({interactionType: 'mouse', advanceTimer: jest.advanceTimersByTime});
351-
// ...
352-
353-
it('CheckboxGroup can select multiple checkboxes', async function () {
354-
// Render your test component/app and initialize the checkbox group tester
355-
let {getByTestId} = render(
356-
<Provider theme={defaultTheme}>
357-
<CheckboxGroup data-testid="test-checkboxgroup">
358-
...
359-
</CheckboxGroup>
360-
</Provider>
361-
);
362-
let checkboxGroupTester = testUtilUser.createTester('CheckboxGroup', {root: getByTestId('test-checkboxgroup')});
363-
expect(checkboxGroupTester.selectedCheckboxes).toHaveLength(0);
364-
365-
await checkboxGroupTester.toggleCheckbox({checkbox: 0});
366-
expect(checkboxGroupTester.checkboxes[0]).toBeChecked();
367-
expect(checkboxGroupTester.selectedCheckboxes).toHaveLength(1);
368-
369-
await checkboxGroupTester.toggleCheckbox({checkbox: 4});
370-
expect(checkboxGroupTester.checkboxes[4]).toBeChecked();
371-
expect(checkboxGroupTester.selectedCheckboxes).toHaveLength(2);
372-
});
373-
```
374-
375-
<ClassAPI links={checkboxgroupUtil.links} class={checkboxgroupUtil.exports.CheckboxGroupTester} />

packages/@react-spectrum/dialog/docs/Dialog.mdx

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export default Layout;
1212

1313
import DialogAnatomy from './images/DialogAnatomy.svg';
1414
import docs from 'docs:@react-spectrum/dialog';
15-
import dialogUtil from 'docs:@react-aria/test-utils/src/dialog.ts';
1615
import {Image, HeaderInfo, PropTable, PageDescription, VersionBadge, ClassAPI} from '@react-spectrum/docs';
1716
import packageData from '@react-spectrum/dialog/package.json';
1817
import styles from '@react-spectrum/docs/src/docs.css';
@@ -399,43 +398,3 @@ respectively for container sizing considerations. Modal sizes on mobile devices
399398
)}
400399
</DialogTrigger>
401400
```
402-
403-
## Testing
404-
405-
### Test utils <VersionBadge version="beta" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
406-
407-
`@react-spectrum/test-utils` offers common dialog interaction utilities which you may find helpful when writing tests. See [here](./testing.html#react-spectrum-test-utils) for more information on how to setup these utilities
408-
in your tests. Below is the full definition of the dialog tester and a sample of how you could use it in your test suite.
409-
410-
```ts
411-
// Dialog.test.ts
412-
import {render} from '@testing-library/react';
413-
import {theme} from '@react-spectrum/theme-default';
414-
import {User} from '@react-spectrum/test-utils';
415-
416-
let testUtilUser = new User({interactionType: 'mouse', advanceTimer: jest.advanceTimersByTime});
417-
// ...
418-
419-
it('Dialog can be opened and closed', async function () {
420-
// Render your test component/app and initialize the dialog tester
421-
let {getByTestId, getByRole} = render(
422-
<Provider theme={defaultTheme}>
423-
<DialogTrigger>
424-
<ActionButton>Trigger</ActionButton>
425-
<Dialog>
426-
...
427-
</Dialog>
428-
</DialogTrigger>
429-
</Provider>
430-
);
431-
let button = getByRole('button');
432-
let dialogTester = testUtilUser.createTester('Dialog', {root: button, overlayType: 'modal'});
433-
await dialogTester.open();
434-
let dialog = dialogTester.dialog;
435-
expect(dialog).toBeVisible();
436-
await dialogTester.close();
437-
expect(dialog).not.toBeInTheDocument();
438-
});
439-
```
440-
441-
<ClassAPI links={dialogUtil.links} class={dialogUtil.exports.DialogTester} />

packages/@react-spectrum/radio/docs/RadioGroup.mdx

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {Layout} from '@react-spectrum/docs';
1111
export default Layout;
1212

1313
import docs from 'docs:@react-spectrum/radio';
14-
import radiogroupUtil from 'docs:@react-aria/test-utils/src/radiogroup.ts';
1514
import packageData from '@react-spectrum/radio/package.json';
1615
import {HeaderInfo, PropTable, PageDescription, VersionBadge, ClassAPI} from '@react-spectrum/docs';
1716

@@ -307,43 +306,3 @@ See the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/
307306
<Radio value="dragon">Dragon</Radio>
308307
</RadioGroup>
309308
```
310-
311-
## Testing
312-
313-
### Test utils <VersionBadge version="beta" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
314-
315-
`@react-spectrum/test-utils` offers common radio group interaction utilities which you may find helpful when writing tests. See [here](./testing.html#react-spectrum-test-utils) for more information on how to setup these utilities
316-
in your tests. Below is the full definition of the radio group tester and a sample of how you could use it in your test suite.
317-
318-
```ts
319-
// RadioGroup.test.ts
320-
import {render} from '@testing-library/react';
321-
import {theme} from '@react-spectrum/theme-default';
322-
import {User} from '@react-spectrum/test-utils';
323-
324-
let testUtilUser = new User({interactionType: 'mouse', advanceTimer: jest.advanceTimersByTime});
325-
// ...
326-
327-
it('RadioGroup can switch the selected radio', async function () {
328-
// Render your test component/app and initialize the radiogroup tester
329-
let {getByRole} = render(
330-
<Provider theme={defaultTheme}>
331-
<RadioGroup>
332-
...
333-
</RadioGroup>
334-
</Provider>
335-
);
336-
337-
let radioGroupTester = testUtilUser.createTester('RadioGroup', {root: getByRole('radiogroup')});
338-
let radios = radioGroupTester.radios;
339-
expect(radioGroupTester.selectedRadio).toBeFalsy();
340-
341-
await radioGroupTester.triggerRadio({radio: radios[0]});
342-
expect(radioGroupTester.selectedRadio).toBe(radios[0]);
343-
344-
await radioGroupTester.triggerRadio({radio: radios[1]});
345-
expect(radioGroupTester.selectedRadio).toBe(radios[1]);
346-
});
347-
```
348-
349-
<ClassAPI links={radiogroupUtil.links} class={radiogroupUtil.exports.RadioGroupTester} />

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,20 +201,14 @@ See below for the full definition of the `User` object.
201201
Below is a list of the ARIA patterns testers currently supported by `createTester`. See the accompanying component testing docs pages for a sample of how to use
202202
the testers in your test suite.
203203

204-
- [CheckboxGroup](CheckboxGroup.html#test-utils)
205-
206204
- [ComboBox](ComboBox.html#test-utils)
207205

208-
- [Dialog](Dialog.html#test-utils)
209-
210206
- [GridList](GridList.html#test-utils)
211207

212208
- [ListBox](ListBox.html#test-utils)
213209

214210
- [Menu](Menu.html#test-utils)
215211

216-
- [RadioGroup](RadioGroup.html#test-utils)
217-
218212
- [Select](Select.html#test-utils)
219213

220214
- [Table](Table.html#test-utils)

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,20 +395,14 @@ See below for the full definition of the `User` object.
395395
Below is a list of the ARIA patterns testers currently supported by `createTester`. See the accompanying component testing docs pages for a sample of how to use
396396
the testers in your test suite.
397397

398-
- [CheckboxGroup](CheckboxGroup.html#test-utils)
399-
400398
- [ComboBox](ComboBox.html#test-utils)
401399

402-
- [Dialog](Dialog.html#test-utils)
403-
404400
- [ListView](ListView.html#test-utils)
405401

406402
- [ListBox](ListBox.html#test-utils)
407403

408404
- [MenuTrigger](MenuTrigger.html#test-utils)
409405

410-
- [RadioGroup](RadioGroup.html#test-utils)
411-
412406
- [Picker](Picker.html#test-utils)
413407

414408
- [TableView](TableView.html#test-utils)

packages/react-aria-components/docs/CheckboxGroup.mdx

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export default Layout;
1313
import docs from 'docs:react-aria-components';
1414
import statelyDocs from 'docs:@react-stately/checkbox';
1515
import typesDocs from 'docs:@react-types/shared/src/events.d.ts';
16-
import checkboxgroupUtil from 'docs:@react-aria/test-utils/src/checkboxgroup.ts';
1716
import {PropTable, HeaderInfo, TypeLink, PageDescription, StateTable, ContextTable, VersionBadge, ClassAPI} from '@react-spectrum/docs';
1817
import styles from '@react-spectrum/docs/src/docs.css';
1918
import packageData from 'react-aria-components/package.json';
@@ -610,40 +609,3 @@ function SelectionCount() {
610609
### Hooks
611610

612611
If you need to customize things further, such as accessing internal state or customizing DOM structure, you can drop down to the lower level Hook-based API. See [useCheckboxGroup](useCheckboxGroup.html) for more details.
613-
614-
## Testing
615-
616-
### Test utils <VersionBadge version="beta" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
617-
618-
`@react-aria/test-utils` offers common checkbox group interaction utilities which you may find helpful when writing tests. See [here](./testing.html#react-aria-test-utils) for more information on how to setup these utilities
619-
in your tests. Below is the full definition of the checkbox group tester and a sample of how you could use it in your test suite.
620-
621-
```ts
622-
// CheckboxGroup.test.ts
623-
import {render} from '@testing-library/react';
624-
import {User} from '@react-aria/test-utils';
625-
626-
let testUtilUser = new User({interactionType: 'mouse', advanceTimer: jest.advanceTimersByTime});
627-
// ...
628-
629-
it('CheckboxGroup can select multiple checkboxes', async function () {
630-
// Render your test component/app and initialize the checkbox group tester
631-
let {getByTestId} = render(
632-
<CheckboxGroup data-testid="test-checkboxgroup">
633-
...
634-
</CheckboxGroup>
635-
);
636-
let checkboxGroupTester = testUtilUser.createTester('CheckboxGroup', {root: getByTestId('test-checkboxgroup')});
637-
expect(checkboxGroupTester.selectedCheckboxes).toHaveLength(0);
638-
639-
await checkboxGroupTester.toggleCheckbox({checkbox: 0});
640-
expect(checkboxGroupTester.checkboxes[0]).toBeChecked();
641-
expect(checkboxGroupTester.selectedCheckboxes).toHaveLength(1);
642-
643-
await checkboxGroupTester.toggleCheckbox({checkbox: 4});
644-
expect(checkboxGroupTester.checkboxes[4]).toBeChecked();
645-
expect(checkboxGroupTester.selectedCheckboxes).toHaveLength(2);
646-
});
647-
```
648-
649-
<ClassAPI links={checkboxgroupUtil.links} class={checkboxgroupUtil.exports.CheckboxGroupTester} />

packages/react-aria-components/docs/Dialog.mdx

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export default Layout;
1212

1313
import docs from 'docs:react-aria-components';
1414
import typesDocs from 'docs:@react-types/overlays';
15-
import dialogUtil from 'docs:@react-aria/test-utils/src/dialog.ts';
1615
import overlayStatelyDocs from 'docs:@react-stately/overlays';
1716
import {PropTable, HeaderInfo, TypeLink, PageDescription, StateTable, ContextTable, VersionBadge, ClassAPI} from '@react-spectrum/docs';
1817
import styles from '@react-spectrum/docs/src/docs.css';
@@ -350,42 +349,3 @@ function CloseButton() {
350349
### Hooks
351350

352351
If you need to customize things further, such as accessing internal state or customizing DOM structure, you can drop down to the lower level Hook-based API. See [useDialog](useDialog.html) for more details.
353-
354-
## Testing
355-
356-
### Test utils <VersionBadge version="beta" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
357-
358-
`@react-aria/test-utils` offers common dialog interaction utilities which you may find helpful when writing tests. See [here](./testing.html#react-aria-test-utils) for more information on how to setup these utilities
359-
in your tests. Below is the full definition of the dialog tester and a sample of how you could use it in your test suite.
360-
361-
```ts
362-
// Dialog.test.ts
363-
import {render} from '@testing-library/react';
364-
import {User} from '@react-aria/test-utils';
365-
366-
let testUtilUser = new User({interactionType: 'mouse', advanceTimer: jest.advanceTimersByTime});
367-
// ...
368-
369-
it('Dialog can be opened and closed', async function () {
370-
// Render your test component/app and initialize the dialog tester
371-
let {getByTestId, getByRole} = render(
372-
<DialogTrigger>
373-
<Button>Trigger</Button>
374-
<Modal>
375-
<Dialog role="alertdialog" data-testid="test-dialog">
376-
...
377-
</Dialog>
378-
</Modal>
379-
</DialogTrigger>
380-
);
381-
let button = getByRole('button');
382-
let dialogTester = testUtilUser.createTester('Dialog', {root: button, overlayType: 'modal'});
383-
await dialogTester.open();
384-
let dialog = dialogTester.dialog;
385-
expect(dialog).toHaveAttribute('role', 'alertdialog');
386-
await dialogTester.close();
387-
expect(dialog).not.toBeInTheDocument();
388-
});
389-
```
390-
391-
<ClassAPI links={dialogUtil.links} class={dialogUtil.exports.DialogTester} />

packages/react-aria-components/docs/RadioGroup.mdx

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export default Layout;
1313
import docs from 'docs:react-aria-components';
1414
import statelyDocs from 'docs:@react-stately/radio';
1515
import typesDocs from 'docs:@react-types/shared/src/events.d.ts';
16-
import radiogroupUtil from 'docs:@react-aria/test-utils/src/radiogroup.ts';
1716
import {PropTable, HeaderInfo, TypeLink, PageDescription, StateTable, ContextTable, VersionBadge, ClassAPI} from '@react-spectrum/docs';
1817
import styles from '@react-spectrum/docs/src/docs.css';
1918
import packageData from 'react-aria-components/package.json';
@@ -631,40 +630,3 @@ RadioGroup provides a <TypeLink links={statelyDocs.links} type={statelyDocs.expo
631630
### Hooks
632631

633632
If you need to customize things further, such as accessing internal state or customizing DOM structure, you can drop down to the lower level Hook-based API. See [useRadioGroup](useRadioGroup.html) for more details.
634-
635-
## Testing
636-
637-
### Test utils <VersionBadge version="beta" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
638-
639-
`@react-aria/test-utils` offers common radio group interaction utilities which you may find helpful when writing tests. See [here](./testing.html#react-aria-test-utils) for more information on how to setup these utilities
640-
in your tests. Below is the full definition of the radio group tester and a sample of how you could use it in your test suite.
641-
642-
```ts
643-
// RadioGroup.test.ts
644-
import {render} from '@testing-library/react';
645-
import {User} from '@react-aria/test-utils';
646-
647-
let testUtilUser = new User({interactionType: 'mouse', advanceTimer: jest.advanceTimersByTime});
648-
// ...
649-
650-
it('RadioGroup can switch the selected radio', async function () {
651-
// Render your test component/app and initialize the radiogroup tester
652-
let {getByRole} = render(
653-
<RadioGroup>
654-
...
655-
</RadioGroup>
656-
);
657-
658-
let radioGroupTester = testUtilUser.createTester('RadioGroup', {root: getByRole('radiogroup')});
659-
let radios = radioGroupTester.radios;
660-
expect(radioGroupTester.selectedRadio).toBeFalsy();
661-
662-
await radioGroupTester.triggerRadio({radio: radios[0]});
663-
expect(radioGroupTester.selectedRadio).toBe(radios[0]);
664-
665-
await radioGroupTester.triggerRadio({radio: radios[1]});
666-
expect(radioGroupTester.selectedRadio).toBe(radios[1]);
667-
});
668-
```
669-
670-
<ClassAPI links={radiogroupUtil.links} class={radiogroupUtil.exports.RadioGroupTester} />

0 commit comments

Comments
 (0)