@instructure/ui-radio-input 10.6.0 → 10.6.1-snapshot-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.
Files changed (34) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/es/RadioInput/__new-tests__/RadioInput.test.js +225 -0
  3. package/es/RadioInputGroup/__new-tests__/RadioInputGroup.test.js +241 -0
  4. package/lib/RadioInput/__new-tests__/RadioInput.test.js +227 -0
  5. package/lib/RadioInputGroup/__new-tests__/RadioInputGroup.test.js +243 -0
  6. package/package.json +17 -13
  7. package/src/RadioInput/__new-tests__/RadioInput.test.tsx +291 -0
  8. package/src/RadioInputGroup/__new-tests__/RadioInputGroup.test.tsx +231 -0
  9. package/tsconfig.build.json +2 -2
  10. package/tsconfig.build.tsbuildinfo +1 -1
  11. package/types/RadioInput/__new-tests__/RadioInput.test.d.ts +2 -0
  12. package/types/RadioInput/__new-tests__/RadioInput.test.d.ts.map +1 -0
  13. package/types/RadioInputGroup/__new-tests__/RadioInputGroup.test.d.ts +2 -0
  14. package/types/RadioInputGroup/__new-tests__/RadioInputGroup.test.d.ts.map +1 -0
  15. package/es/RadioInput/RadioInputLocator.js +0 -29
  16. package/es/RadioInput/locator.js +0 -27
  17. package/es/RadioInputGroup/RadioInputGroupLocator.js +0 -29
  18. package/es/RadioInputGroup/locator.js +0 -27
  19. package/lib/RadioInput/RadioInputLocator.js +0 -34
  20. package/lib/RadioInput/locator.js +0 -37
  21. package/lib/RadioInputGroup/RadioInputGroupLocator.js +0 -34
  22. package/lib/RadioInputGroup/locator.js +0 -37
  23. package/src/RadioInput/RadioInputLocator.ts +0 -30
  24. package/src/RadioInput/locator.ts +0 -28
  25. package/src/RadioInputGroup/RadioInputGroupLocator.ts +0 -30
  26. package/src/RadioInputGroup/locator.ts +0 -28
  27. package/types/RadioInput/RadioInputLocator.d.ts +0 -310
  28. package/types/RadioInput/RadioInputLocator.d.ts.map +0 -1
  29. package/types/RadioInput/locator.d.ts +0 -4
  30. package/types/RadioInput/locator.d.ts.map +0 -1
  31. package/types/RadioInputGroup/RadioInputGroupLocator.d.ts +0 -310
  32. package/types/RadioInputGroup/RadioInputGroupLocator.d.ts.map +0 -1
  33. package/types/RadioInputGroup/locator.d.ts +0 -4
  34. package/types/RadioInputGroup/locator.d.ts.map +0 -1
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _react = _interopRequireDefault(require("react"));
5
+ var _react2 = require("@testing-library/react");
6
+ var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
7
+ var _vitest = require("vitest");
8
+ require("@testing-library/jest-dom");
9
+ var _runAxeCheck = require("@instructure/ui-axe-check/lib/runAxeCheck.js");
10
+ var _index = require("../index");
11
+ var _RadioInput, _RadioInput2, _RadioInput3;
12
+ /*
13
+ * The MIT License (MIT)
14
+ *
15
+ * Copyright (c) 2015 - present Instructure, Inc.
16
+ *
17
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ * of this software and associated documentation files (the "Software"), to deal
19
+ * in the Software without restriction, including without limitation the rights
20
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ * copies of the Software, and to permit persons to whom the Software is
22
+ * furnished to do so, subject to the following conditions:
23
+ *
24
+ * The above copyright notice and this permission notice shall be included in all
25
+ * copies or substantial portions of the Software.
26
+ *
27
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
+ * SOFTWARE.
34
+ */
35
+ describe('<RadioInput />', () => {
36
+ let consoleWarningMock;
37
+ let consoleErrorMock;
38
+ beforeEach(() => {
39
+ // Mocking console to prevent test output pollution
40
+ consoleWarningMock = _vitest.vi.spyOn(console, 'warn').mockImplementation(() => {});
41
+ consoleErrorMock = _vitest.vi.spyOn(console, 'error').mockImplementation(() => {});
42
+ });
43
+ afterEach(() => {
44
+ consoleWarningMock.mockRestore();
45
+ consoleErrorMock.mockRestore();
46
+ });
47
+ it('renders an input with type "radio"', async () => {
48
+ const _render = (0, _react2.render)(_RadioInput || (_RadioInput = /*#__PURE__*/_react.default.createElement(_index.RadioInput, {
49
+ label: "fake label",
50
+ value: "someValue",
51
+ name: "someName"
52
+ }))),
53
+ container = _render.container;
54
+ const input = container.querySelector('input');
55
+ expect(input).toBeInTheDocument();
56
+ expect(input).toHaveAttribute('type', 'radio');
57
+ });
58
+ describe('events', () => {
59
+ it('responds to onClick event', async () => {
60
+ const onClick = _vitest.vi.fn();
61
+ const _render2 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInput, {
62
+ label: "fake label",
63
+ value: "someValue",
64
+ name: "someName",
65
+ onClick: onClick
66
+ })),
67
+ container = _render2.container;
68
+ const input = container.querySelector('input');
69
+ _userEvent.default.click(input);
70
+ await (0, _react2.waitFor)(() => {
71
+ expect(onClick).toHaveBeenCalled();
72
+ });
73
+ });
74
+ it('does not respond to onClick event when disabled', async () => {
75
+ const onClick = _vitest.vi.fn();
76
+ const _render3 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInput, {
77
+ disabled: true,
78
+ label: "fake label",
79
+ value: "someValue",
80
+ name: "someName",
81
+ onClick: onClick
82
+ })),
83
+ container = _render3.container;
84
+ const input = container.querySelector('input');
85
+ _react2.fireEvent.click(input);
86
+ await (0, _react2.waitFor)(() => {
87
+ expect(onClick).not.toHaveBeenCalled();
88
+ expect(input).toBeDisabled();
89
+ });
90
+ });
91
+ it('does not respond to onClick event when readOnly', async () => {
92
+ const onClick = _vitest.vi.fn();
93
+ const _render4 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInput, {
94
+ readOnly: true,
95
+ label: "fake label",
96
+ value: "someValue",
97
+ name: "someName",
98
+ onClick: onClick
99
+ })),
100
+ container = _render4.container;
101
+ const input = container.querySelector('input');
102
+ _react2.fireEvent.click(input);
103
+ await (0, _react2.waitFor)(() => {
104
+ expect(onClick).not.toHaveBeenCalled();
105
+ expect(input).toBeDisabled();
106
+ });
107
+ });
108
+ it('responds to onChange event', async () => {
109
+ const onChange = _vitest.vi.fn();
110
+ const _render5 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInput, {
111
+ label: "fake label",
112
+ value: "someValue",
113
+ name: "someName",
114
+ onChange: onChange
115
+ })),
116
+ container = _render5.container;
117
+ const input = container.querySelector('input');
118
+ _userEvent.default.click(input);
119
+ await (0, _react2.waitFor)(() => {
120
+ expect(onChange).toHaveBeenCalled();
121
+ });
122
+ });
123
+ it('does not respond to onChange event when disabled', async () => {
124
+ const onChange = _vitest.vi.fn();
125
+ const _render6 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInput, {
126
+ disabled: true,
127
+ label: "fake label",
128
+ value: "someValue",
129
+ name: "someName",
130
+ onChange: onChange
131
+ })),
132
+ container = _render6.container;
133
+ const input = container.querySelector('input');
134
+ _react2.fireEvent.click(input);
135
+ await (0, _react2.waitFor)(() => {
136
+ expect(onChange).not.toHaveBeenCalled();
137
+ });
138
+ });
139
+ it('does not respond to onChange event when readOnly', async () => {
140
+ const onChange = _vitest.vi.fn();
141
+ const _render7 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInput, {
142
+ readOnly: true,
143
+ label: "fake label",
144
+ value: "someValue",
145
+ name: "someName",
146
+ onChange: onChange
147
+ })),
148
+ container = _render7.container;
149
+ const input = container.querySelector('input');
150
+ _react2.fireEvent.click(input);
151
+ await (0, _react2.waitFor)(() => {
152
+ expect(onChange).not.toHaveBeenCalled();
153
+ });
154
+ });
155
+ it('responds to onBlur event', async () => {
156
+ const onBlur = _vitest.vi.fn();
157
+ const _render8 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInput, {
158
+ label: "fake label",
159
+ value: "someValue",
160
+ name: "someName",
161
+ onBlur: onBlur
162
+ })),
163
+ container = _render8.container;
164
+ const input = container.querySelector('input');
165
+ _react2.fireEvent.focusOut(input);
166
+ await (0, _react2.waitFor)(() => {
167
+ expect(onBlur).toHaveBeenCalled();
168
+ });
169
+ });
170
+ it('responds to onFocus event', async () => {
171
+ const onFocus = _vitest.vi.fn();
172
+ const _render9 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInput, {
173
+ label: "fake label",
174
+ value: "someValue",
175
+ name: "someName",
176
+ onFocus: onFocus
177
+ })),
178
+ container = _render9.container;
179
+ const input = container.querySelector('input');
180
+ _react2.fireEvent.focus(input);
181
+ await (0, _react2.waitFor)(() => {
182
+ expect(onFocus).toHaveBeenCalled();
183
+ });
184
+ });
185
+ it('sets input to checked when selected', async () => {
186
+ const _render10 = (0, _react2.render)(_RadioInput2 || (_RadioInput2 = /*#__PURE__*/_react.default.createElement(_index.RadioInput, {
187
+ checked: true,
188
+ label: "fake label",
189
+ value: "someValue",
190
+ name: "someName"
191
+ }))),
192
+ container = _render10.container;
193
+ const input = container.querySelector('input');
194
+ expect(input).toHaveAttribute('checked');
195
+ });
196
+ it('focuses with the focus helper', async () => {
197
+ let ref;
198
+ const _render11 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInput, {
199
+ label: "fake label",
200
+ value: "someValue",
201
+ name: "someName"
202
+ // @ts-expect-error this is managed by the testing framework
203
+ ,
204
+ ref: el => ref = el
205
+ })),
206
+ container = _render11.container;
207
+ const input = container.querySelector('input');
208
+ ref.focus();
209
+ await (0, _react2.waitFor)(() => {
210
+ expect(document.activeElement).toBe(input);
211
+ });
212
+ });
213
+ });
214
+ describe('for a11y', () => {
215
+ it('simple variant should meet a11y standards', async () => {
216
+ const _render12 = (0, _react2.render)(_RadioInput3 || (_RadioInput3 = /*#__PURE__*/_react.default.createElement(_index.RadioInput, {
217
+ variant: "simple",
218
+ label: "fake label",
219
+ value: "someValue",
220
+ name: "someName"
221
+ }))),
222
+ container = _render12.container;
223
+ const axeCheck = await (0, _runAxeCheck.runAxeCheck)(container);
224
+ expect(axeCheck).toBe(true);
225
+ });
226
+ });
227
+ });
@@ -0,0 +1,243 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _react = _interopRequireDefault(require("react"));
5
+ var _react2 = require("@testing-library/react");
6
+ var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
7
+ var _vitest = require("vitest");
8
+ require("@testing-library/jest-dom");
9
+ var _runAxeCheck = require("@instructure/ui-axe-check/lib/runAxeCheck.js");
10
+ var _RadioInput13 = require("../../RadioInput");
11
+ var _index = require("../index");
12
+ var _RadioInputGroup, _RadioInputGroup2, _RadioInput, _RadioInput2, _RadioInput3, _RadioInput4, _RadioInput5, _RadioInput6, _RadioInput7, _RadioInput8, _RadioInput9, _RadioInput10, _RadioInput11, _RadioInput12, _RadioInputGroup3, _RadioInputGroup4, _RadioInputGroup5;
13
+ /*
14
+ * The MIT License (MIT)
15
+ *
16
+ * Copyright (c) 2015 - present Instructure, Inc.
17
+ *
18
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
19
+ * of this software and associated documentation files (the "Software"), to deal
20
+ * in the Software without restriction, including without limitation the rights
21
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22
+ * copies of the Software, and to permit persons to whom the Software is
23
+ * furnished to do so, subject to the following conditions:
24
+ *
25
+ * The above copyright notice and this permission notice shall be included in all
26
+ * copies or substantial portions of the Software.
27
+ *
28
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34
+ * SOFTWARE.
35
+ */
36
+ describe('<RadioInputGroup />', () => {
37
+ let consoleWarningMock;
38
+ let consoleErrorMock;
39
+ beforeEach(() => {
40
+ // Mocking console to prevent test output pollution and expect for messages
41
+ consoleWarningMock = _vitest.vi.spyOn(console, 'warn').mockImplementation(() => {});
42
+ consoleErrorMock = _vitest.vi.spyOn(console, 'error').mockImplementation(() => {});
43
+ });
44
+ afterEach(() => {
45
+ consoleWarningMock.mockRestore();
46
+ consoleErrorMock.mockRestore();
47
+ });
48
+ it('adds the name props to all RadioInput types', async () => {
49
+ const _render = (0, _react2.render)(_RadioInputGroup || (_RadioInputGroup = /*#__PURE__*/_react.default.createElement(_index.RadioInputGroup, {
50
+ name: "fruit",
51
+ description: "Select a fruit"
52
+ }, /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
53
+ label: "Apple",
54
+ value: "apple"
55
+ }), /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
56
+ label: "Banana",
57
+ value: "banana"
58
+ }), /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
59
+ label: "Orange",
60
+ value: "orange"
61
+ })))),
62
+ container = _render.container;
63
+ const inputs = await container.querySelectorAll('input[name="fruit"]');
64
+ expect(inputs.length).toBe(3);
65
+ });
66
+ it('requires an `onChange` prop with a `value` prop', async () => {
67
+ (0, _react2.render)(_RadioInputGroup2 || (_RadioInputGroup2 = /*#__PURE__*/_react.default.createElement(_index.RadioInputGroup, {
68
+ name: "fruit",
69
+ description: "Select a fruit",
70
+ value: "banana"
71
+ }, /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
72
+ label: "Apple",
73
+ value: "apple"
74
+ }), /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
75
+ label: "Banana",
76
+ value: "banana"
77
+ }), /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
78
+ label: "Orange",
79
+ value: "orange"
80
+ }))));
81
+ const expectedErrorMessage = `provided a 'value' prop without an 'onChange' handler`;
82
+ expect(consoleErrorMock).toHaveBeenCalledWith(expect.any(String), expect.any(String), expect.stringContaining(expectedErrorMessage), expect.any(String));
83
+ });
84
+ it('calls the onChange prop', async () => {
85
+ const onChange = _vitest.vi.fn();
86
+ const _render2 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInputGroup, {
87
+ name: "fruit",
88
+ description: "Select a fruit",
89
+ onChange: onChange
90
+ }, _RadioInput || (_RadioInput = /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
91
+ label: "Apple",
92
+ value: "apple"
93
+ })), _RadioInput2 || (_RadioInput2 = /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
94
+ label: "Banana",
95
+ value: "banana"
96
+ })), _RadioInput3 || (_RadioInput3 = /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
97
+ label: "Orange",
98
+ value: "orange"
99
+ })))),
100
+ container = _render2.container;
101
+ const input = container.querySelector('input');
102
+ _userEvent.default.click(input);
103
+ await (0, _react2.waitFor)(() => {
104
+ expect(onChange).toHaveBeenCalled();
105
+ });
106
+ });
107
+ it('does not call the onChange prop when disabled', async () => {
108
+ const onChange = _vitest.vi.fn();
109
+ const _render3 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInputGroup, {
110
+ disabled: true,
111
+ name: "fruit",
112
+ description: "Select a fruit",
113
+ onChange: onChange
114
+ }, _RadioInput4 || (_RadioInput4 = /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
115
+ label: "Apple",
116
+ value: "apple"
117
+ })), _RadioInput5 || (_RadioInput5 = /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
118
+ label: "Banana",
119
+ value: "banana"
120
+ })), _RadioInput6 || (_RadioInput6 = /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
121
+ label: "Orange",
122
+ value: "orange"
123
+ })))),
124
+ container = _render3.container;
125
+ const input = container.querySelector('input');
126
+ _react2.fireEvent.click(input);
127
+ await (0, _react2.waitFor)(() => {
128
+ expect(onChange).not.toHaveBeenCalled();
129
+ expect(input).toBeDisabled();
130
+ });
131
+ });
132
+ it('does not call the onChange prop when readOnly', async () => {
133
+ const onChange = _vitest.vi.fn();
134
+ const _render4 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInputGroup, {
135
+ readOnly: true,
136
+ name: "fruit",
137
+ description: "Select a fruit",
138
+ onChange: onChange
139
+ }, _RadioInput7 || (_RadioInput7 = /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
140
+ label: "Apple",
141
+ value: "apple"
142
+ })), _RadioInput8 || (_RadioInput8 = /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
143
+ label: "Banana",
144
+ value: "banana"
145
+ })), _RadioInput9 || (_RadioInput9 = /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
146
+ label: "Orange",
147
+ value: "orange"
148
+ })))),
149
+ container = _render4.container;
150
+ const input = container.querySelector('input');
151
+ _react2.fireEvent.click(input);
152
+ await (0, _react2.waitFor)(() => {
153
+ expect(onChange).not.toHaveBeenCalled();
154
+ expect(input).toBeDisabled();
155
+ });
156
+ });
157
+ it('should not update the value when the value prop is set', async () => {
158
+ const _render5 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.RadioInputGroup, {
159
+ name: "fruit",
160
+ description: "Select a fruit",
161
+ value: "orange",
162
+ onChange: () => {}
163
+ }, _RadioInput10 || (_RadioInput10 = /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
164
+ label: "Apple",
165
+ value: "apple"
166
+ })), _RadioInput11 || (_RadioInput11 = /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
167
+ label: "Banana",
168
+ value: "banana"
169
+ })), _RadioInput12 || (_RadioInput12 = /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
170
+ label: "Orange",
171
+ value: "orange"
172
+ })))),
173
+ container = _render5.container;
174
+ const banana = container.querySelector('input[value="banana"]');
175
+ const orange = container.querySelector('input[value="orange"]');
176
+ expect(orange).toHaveAttribute('checked');
177
+ _userEvent.default.click(banana);
178
+ await (0, _react2.waitFor)(() => {
179
+ expect(orange).toHaveAttribute('checked');
180
+ });
181
+ });
182
+ it('adds the correct tabindex to RadioInputs when none are checked', async () => {
183
+ const _render6 = (0, _react2.render)(_RadioInputGroup3 || (_RadioInputGroup3 = /*#__PURE__*/_react.default.createElement(_index.RadioInputGroup, {
184
+ name: "fruit",
185
+ description: "Select a fruit"
186
+ }, /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
187
+ label: "Apple",
188
+ value: "apple"
189
+ }), /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
190
+ label: "Banana",
191
+ value: "banana"
192
+ }), /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
193
+ label: "Orange",
194
+ value: "orange"
195
+ })))),
196
+ container = _render6.container;
197
+ const inputs = container.querySelectorAll('input[name="fruit"]');
198
+ expect(inputs[0]).toHaveAttribute('tabindex', '0');
199
+ expect(inputs[1]).toHaveAttribute('tabindex', '-1');
200
+ expect(inputs[2]).toHaveAttribute('tabindex', '-1');
201
+ });
202
+ it('adds the correct tabindex to RadioInputs when checked', async () => {
203
+ const _render7 = (0, _react2.render)(_RadioInputGroup4 || (_RadioInputGroup4 = /*#__PURE__*/_react.default.createElement(_index.RadioInputGroup, {
204
+ name: "fruit",
205
+ description: "Select a fruit",
206
+ defaultValue: "banana"
207
+ }, /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
208
+ label: "Apple",
209
+ value: "apple"
210
+ }), /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
211
+ label: "Banana",
212
+ value: "banana"
213
+ }), /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
214
+ label: "Orange",
215
+ value: "orange"
216
+ })))),
217
+ container = _render7.container;
218
+ const inputs = container.querySelectorAll('input[name="fruit"]');
219
+ expect(inputs[0]).toHaveAttribute('tabindex', '-1');
220
+ expect(inputs[1]).toHaveAttribute('tabindex', '0');
221
+ expect(inputs[2]).toHaveAttribute('tabindex', '-1');
222
+ });
223
+ describe('for a11y', () => {
224
+ it('should meet a11y standards', async () => {
225
+ const _render8 = (0, _react2.render)(_RadioInputGroup5 || (_RadioInputGroup5 = /*#__PURE__*/_react.default.createElement(_index.RadioInputGroup, {
226
+ name: "fruit",
227
+ description: "Select a fruit"
228
+ }, /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
229
+ label: "Apple",
230
+ value: "apple"
231
+ }), /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
232
+ label: "Banana",
233
+ value: "banana"
234
+ }), /*#__PURE__*/_react.default.createElement(_RadioInput13.RadioInput, {
235
+ label: "Orange",
236
+ value: "orange"
237
+ })))),
238
+ container = _render8.container;
239
+ const axeCheck = await (0, _runAxeCheck.runAxeCheck)(container);
240
+ expect(axeCheck).toBe(true);
241
+ });
242
+ });
243
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-radio-input",
3
- "version": "10.6.0",
3
+ "version": "10.6.1-snapshot-2",
4
4
  "description": "A styled HTML input type='radio' element",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -24,21 +24,25 @@
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
26
  "@babel/runtime": "^7.25.6",
27
- "@instructure/emotion": "10.6.0",
28
- "@instructure/shared-types": "10.6.0",
29
- "@instructure/ui-dom-utils": "10.6.0",
30
- "@instructure/ui-form-field": "10.6.0",
31
- "@instructure/ui-prop-types": "10.6.0",
32
- "@instructure/ui-react-utils": "10.6.0",
33
- "@instructure/ui-testable": "10.6.0",
27
+ "@instructure/emotion": "10.6.1-snapshot-2",
28
+ "@instructure/shared-types": "10.6.1-snapshot-2",
29
+ "@instructure/ui-dom-utils": "10.6.1-snapshot-2",
30
+ "@instructure/ui-form-field": "10.6.1-snapshot-2",
31
+ "@instructure/ui-prop-types": "10.6.1-snapshot-2",
32
+ "@instructure/ui-react-utils": "10.6.1-snapshot-2",
33
+ "@instructure/ui-testable": "10.6.1-snapshot-2",
34
34
  "prop-types": "^15.8.1"
35
35
  },
36
36
  "devDependencies": {
37
- "@instructure/ui-babel-preset": "10.6.0",
38
- "@instructure/ui-color-utils": "10.6.0",
39
- "@instructure/ui-test-locator": "10.6.0",
40
- "@instructure/ui-test-utils": "10.6.0",
41
- "@instructure/ui-themes": "10.6.0"
37
+ "@instructure/ui-axe-check": "10.6.1-snapshot-2",
38
+ "@instructure/ui-babel-preset": "10.6.1-snapshot-2",
39
+ "@instructure/ui-color-utils": "10.6.1-snapshot-2",
40
+ "@instructure/ui-test-utils": "10.6.1-snapshot-2",
41
+ "@instructure/ui-themes": "10.6.1-snapshot-2",
42
+ "@testing-library/jest-dom": "^6.4.6",
43
+ "@testing-library/react": "^16.0.1",
44
+ "@testing-library/user-event": "^14.5.2",
45
+ "vitest": "^2.1.1"
42
46
  },
43
47
  "peerDependencies": {
44
48
  "react": ">=16.8 <=18"