@react-aria/test-utils 1.0.0-beta.0 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checkboxgroup.main.js +104 -0
- package/dist/checkboxgroup.main.js.map +1 -0
- package/dist/checkboxgroup.mjs +99 -0
- package/dist/checkboxgroup.module.js +99 -0
- package/dist/checkboxgroup.module.js.map +1 -0
- package/dist/dialog.main.js +105 -0
- package/dist/dialog.main.js.map +1 -0
- package/dist/dialog.mjs +100 -0
- package/dist/dialog.module.js +100 -0
- package/dist/dialog.module.js.map +1 -0
- package/dist/main.js.map +1 -1
- package/dist/module.js.map +1 -1
- package/dist/radiogroup.main.js +123 -0
- package/dist/radiogroup.main.js.map +1 -0
- package/dist/radiogroup.mjs +118 -0
- package/dist/radiogroup.module.js +118 -0
- package/dist/radiogroup.module.js.map +1 -0
- package/dist/select.main.js +2 -1
- package/dist/select.main.js.map +1 -1
- package/dist/select.mjs +2 -1
- package/dist/select.module.js +2 -1
- package/dist/select.module.js.map +1 -1
- package/dist/tabs.main.js +5 -3
- package/dist/tabs.main.js.map +1 -1
- package/dist/tabs.mjs +5 -3
- package/dist/tabs.module.js +5 -3
- package/dist/tabs.module.js.map +1 -1
- package/dist/testSetup.main.js +29 -28
- package/dist/testSetup.main.js.map +1 -1
- package/dist/testSetup.mjs +30 -29
- package/dist/testSetup.module.js +30 -29
- package/dist/testSetup.module.js.map +1 -1
- package/dist/types.d.ts +142 -13
- package/dist/types.d.ts.map +1 -1
- package/dist/user.main.js +12 -3
- package/dist/user.main.js.map +1 -1
- package/dist/user.mjs +12 -3
- package/dist/user.module.js +12 -3
- package/dist/user.module.js.map +1 -1
- package/package.json +2 -2
- package/src/checkboxgroup.ts +158 -0
- package/src/dialog.ts +143 -0
- package/src/index.ts +11 -0
- package/src/radiogroup.ts +176 -0
- package/src/select.ts +3 -1
- package/src/tabs.ts +7 -2
- package/src/testSetup.ts +30 -28
- package/src/types.ts +21 -0
- package/src/user.ts +25 -7
package/src/user.ts
CHANGED
|
@@ -10,22 +10,28 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import {CheckboxGroupTester} from './checkboxgroup';
|
|
14
14
|
import {
|
|
15
|
+
CheckboxGroupTesterOpts,
|
|
15
16
|
ComboBoxTesterOpts,
|
|
17
|
+
DialogTesterOpts,
|
|
16
18
|
GridListTesterOpts,
|
|
17
19
|
ListBoxTesterOpts,
|
|
18
20
|
MenuTesterOpts,
|
|
21
|
+
RadioGroupTesterOpts,
|
|
19
22
|
SelectTesterOpts,
|
|
20
23
|
TableTesterOpts,
|
|
21
24
|
TabsTesterOpts,
|
|
22
25
|
TreeTesterOpts,
|
|
23
26
|
UserOpts
|
|
24
27
|
} from './types';
|
|
28
|
+
import {ComboBoxTester} from './combobox';
|
|
29
|
+
import {DialogTester} from './dialog';
|
|
25
30
|
import {GridListTester} from './gridlist';
|
|
26
31
|
import {ListBoxTester} from './listbox';
|
|
27
32
|
import {MenuTester} from './menu';
|
|
28
33
|
import {pointerMap} from './';
|
|
34
|
+
import {RadioGroupTester} from './radiogroup';
|
|
29
35
|
import {SelectTester} from './select';
|
|
30
36
|
import {TableTester} from './table';
|
|
31
37
|
import {TabsTester} from './tabs';
|
|
@@ -33,21 +39,27 @@ import {TreeTester} from './tree';
|
|
|
33
39
|
import userEvent from '@testing-library/user-event';
|
|
34
40
|
|
|
35
41
|
let keyToUtil: {
|
|
36
|
-
'
|
|
37
|
-
'Table': typeof TableTester,
|
|
38
|
-
'Menu': typeof MenuTester,
|
|
42
|
+
'CheckboxGroup': typeof CheckboxGroupTester,
|
|
39
43
|
'ComboBox': typeof ComboBoxTester,
|
|
44
|
+
'Dialog': typeof DialogTester,
|
|
40
45
|
'GridList': typeof GridListTester,
|
|
41
46
|
'ListBox': typeof ListBoxTester,
|
|
47
|
+
'Menu': typeof MenuTester,
|
|
48
|
+
'RadioGroup': typeof RadioGroupTester,
|
|
49
|
+
'Select': typeof SelectTester,
|
|
50
|
+
'Table': typeof TableTester,
|
|
42
51
|
'Tabs': typeof TabsTester,
|
|
43
52
|
'Tree': typeof TreeTester
|
|
44
53
|
} = {
|
|
45
|
-
'
|
|
46
|
-
'Table': TableTester,
|
|
47
|
-
'Menu': MenuTester,
|
|
54
|
+
'CheckboxGroup': CheckboxGroupTester,
|
|
48
55
|
'ComboBox': ComboBoxTester,
|
|
56
|
+
'Dialog': DialogTester,
|
|
49
57
|
'GridList': GridListTester,
|
|
50
58
|
'ListBox': ListBoxTester,
|
|
59
|
+
'Menu': MenuTester,
|
|
60
|
+
'RadioGroup': RadioGroupTester,
|
|
61
|
+
'Select': SelectTester,
|
|
62
|
+
'Table': TableTester,
|
|
51
63
|
'Tabs': TabsTester,
|
|
52
64
|
'Tree': TreeTester
|
|
53
65
|
} as const;
|
|
@@ -55,10 +67,13 @@ export type PatternNames = keyof typeof keyToUtil;
|
|
|
55
67
|
|
|
56
68
|
// Conditional type: https://www.typescriptlang.org/docs/handbook/2/conditional-types.html
|
|
57
69
|
type Tester<T> =
|
|
70
|
+
T extends 'CheckboxGroup' ? CheckboxGroupTester :
|
|
58
71
|
T extends 'ComboBox' ? ComboBoxTester :
|
|
72
|
+
T extends 'Dialog' ? DialogTester :
|
|
59
73
|
T extends 'GridList' ? GridListTester :
|
|
60
74
|
T extends 'ListBox' ? ListBoxTester :
|
|
61
75
|
T extends 'Menu' ? MenuTester :
|
|
76
|
+
T extends 'RadioGroup' ? RadioGroupTester :
|
|
62
77
|
T extends 'Select' ? SelectTester :
|
|
63
78
|
T extends 'Table' ? TableTester :
|
|
64
79
|
T extends 'Tabs' ? TabsTester :
|
|
@@ -66,10 +81,13 @@ type Tester<T> =
|
|
|
66
81
|
never;
|
|
67
82
|
|
|
68
83
|
type TesterOpts<T> =
|
|
84
|
+
T extends 'CheckboxGroup' ? CheckboxGroupTesterOpts :
|
|
69
85
|
T extends 'ComboBox' ? ComboBoxTesterOpts :
|
|
86
|
+
T extends 'Dialog' ? DialogTesterOpts :
|
|
70
87
|
T extends 'GridList' ? GridListTesterOpts :
|
|
71
88
|
T extends 'ListBox' ? ListBoxTesterOpts :
|
|
72
89
|
T extends 'Menu' ? MenuTesterOpts :
|
|
90
|
+
T extends 'RadioGroup' ? RadioGroupTesterOpts :
|
|
73
91
|
T extends 'Select' ? SelectTesterOpts :
|
|
74
92
|
T extends 'Table' ? TableTesterOpts :
|
|
75
93
|
T extends 'Tabs' ? TabsTesterOpts :
|