@instructure/ui-drilldown 10.16.1-snapshot-0 → 10.16.1

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 (51) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/es/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.js +448 -325
  3. package/es/Drilldown/DrilldownGroup/index.js +0 -1
  4. package/es/Drilldown/DrilldownOption/__new-tests__/DrilldownOption.test.js +422 -309
  5. package/es/Drilldown/DrilldownOption/index.js +0 -1
  6. package/es/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.js +201 -147
  7. package/es/Drilldown/DrilldownPage/index.js +0 -1
  8. package/es/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.js +22 -17
  9. package/es/Drilldown/DrilldownSeparator/index.js +0 -1
  10. package/es/Drilldown/__examples__/Drilldown.examples.js +99 -82
  11. package/es/Drilldown/__new-tests__/Drilldown.test.js +533 -352
  12. package/es/Drilldown/index.js +144 -126
  13. package/lib/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.js +463 -340
  14. package/lib/Drilldown/DrilldownGroup/index.js +0 -1
  15. package/lib/Drilldown/DrilldownOption/__new-tests__/DrilldownOption.test.js +448 -336
  16. package/lib/Drilldown/DrilldownOption/index.js +0 -1
  17. package/lib/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.js +221 -167
  18. package/lib/Drilldown/DrilldownPage/index.js +0 -2
  19. package/lib/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.js +25 -21
  20. package/lib/Drilldown/DrilldownSeparator/index.js +0 -1
  21. package/lib/Drilldown/__examples__/Drilldown.examples.js +99 -83
  22. package/lib/Drilldown/__new-tests__/Drilldown.test.js +568 -387
  23. package/lib/Drilldown/index.js +143 -126
  24. package/package.json +21 -21
  25. package/src/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.tsx +0 -1
  26. package/src/Drilldown/DrilldownGroup/index.tsx +0 -1
  27. package/src/Drilldown/DrilldownOption/__new-tests__/DrilldownOption.test.tsx +1 -1
  28. package/src/Drilldown/DrilldownOption/index.tsx +0 -1
  29. package/src/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.tsx +0 -1
  30. package/src/Drilldown/DrilldownPage/index.tsx +0 -1
  31. package/src/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.tsx +0 -1
  32. package/src/Drilldown/DrilldownSeparator/index.tsx +0 -1
  33. package/src/Drilldown/__examples__/Drilldown.examples.tsx +0 -2
  34. package/src/Drilldown/__new-tests__/Drilldown.test.tsx +0 -1
  35. package/src/Drilldown/index.tsx +4 -6
  36. package/tsconfig.build.tsbuildinfo +1 -1
  37. package/types/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.d.ts.map +1 -1
  38. package/types/Drilldown/DrilldownGroup/index.d.ts +0 -1
  39. package/types/Drilldown/DrilldownGroup/index.d.ts.map +1 -1
  40. package/types/Drilldown/DrilldownOption/index.d.ts +0 -1
  41. package/types/Drilldown/DrilldownOption/index.d.ts.map +1 -1
  42. package/types/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.d.ts.map +1 -1
  43. package/types/Drilldown/DrilldownPage/index.d.ts +0 -1
  44. package/types/Drilldown/DrilldownPage/index.d.ts.map +1 -1
  45. package/types/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.d.ts.map +1 -1
  46. package/types/Drilldown/DrilldownSeparator/index.d.ts +0 -1
  47. package/types/Drilldown/DrilldownSeparator/index.d.ts.map +1 -1
  48. package/types/Drilldown/__examples__/Drilldown.examples.d.ts.map +1 -1
  49. package/types/Drilldown/__new-tests__/Drilldown.test.d.ts.map +1 -1
  50. package/types/Drilldown/index.d.ts +7 -10
  51. package/types/Drilldown/index.d.ts.map +1 -1
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _react = _interopRequireDefault(require("react"));
5
- var _react2 = require("@testing-library/react");
4
+ var _react = require("@testing-library/react");
6
5
  var _vitest = require("vitest");
7
6
  var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
8
7
  require("@testing-library/jest-dom");
9
8
  var _index = require("../../index");
9
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
10
10
  var _Drilldown, _Drilldown$Option, _Drilldown2, _Drilldown$Option2, _Drilldown3, _Drilldown4, _Drilldown5, _Drilldown6, _Drilldown7, _Drilldown8, _Drilldown9, _Drilldown10, _Drilldown11, _Drilldown12, _Drilldown13, _Drilldown14, _Drilldown15, _Drilldown16, _Drilldown$Option3, _Drilldown$Option4, _Drilldown$Option5, _Drilldown$Option6, _Drilldown$Option7, _Drilldown$Option8, _Drilldown$Option9, _Drilldown$Option10, _Drilldown$Option11, _Drilldown$Option12, _Drilldown$Option13, _Drilldown$Option14, _Drilldown$Option15, _Drilldown$Option16, _Drilldown$Option17;
11
11
  /*
12
12
  * The MIT License (MIT)
@@ -48,147 +48,184 @@ describe('<Drilldown.Group />', () => {
48
48
  const Example = ({
49
49
  opts
50
50
  }) => {
51
- return /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
52
- rootPageId: "page0"
53
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
54
- id: "page0"
55
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
56
- id: "group0",
57
- selectableType: "single"
58
- }, opts.map(opt => {
59
- return /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
60
- key: opt,
61
- value: opt,
62
- name: opt,
63
- id: opt,
64
- defaultSelected: opt === 'three',
65
- "data-testid": opt
66
- }, opt);
67
- }))));
51
+ return (0, _jsxRuntime.jsx)(_index.Drilldown, {
52
+ rootPageId: "page0",
53
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
54
+ id: "page0",
55
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Group, {
56
+ id: "group0",
57
+ selectableType: "single",
58
+ children: opts.map(opt => {
59
+ return (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
60
+ value: opt,
61
+ name: opt,
62
+ id: opt,
63
+ defaultSelected: opt === 'three',
64
+ "data-testid": opt,
65
+ children: opt
66
+ }, opt);
67
+ })
68
+ })
69
+ })
70
+ });
68
71
  };
69
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(Example, {
72
+ (0, _react.render)((0, _jsxRuntime.jsx)(Example, {
70
73
  opts: options
71
74
  }));
72
- const selectedOption = _react2.screen.getByTestId('three');
75
+ const selectedOption = _react.screen.getByTestId('three');
73
76
  expect(selectedOption).toHaveAttribute('aria-checked', 'true');
74
77
  await _userEvent.default.click(selectedOption);
75
- await (0, _react2.waitFor)(() => {
76
- const updatedSelectedOption = _react2.screen.getByTestId('three');
78
+ await (0, _react.waitFor)(() => {
79
+ const updatedSelectedOption = _react.screen.getByTestId('three');
77
80
  expect(updatedSelectedOption).toHaveAttribute('aria-checked', 'true');
78
81
  });
79
82
  });
80
83
  it("shouldn't render non-DrilldownGroup children", async () => {
81
- (0, _react2.render)(_Drilldown || (_Drilldown = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
82
- rootPageId: "page0"
83
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
84
- id: "page0"
85
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
86
- id: "group0"
87
- }, /*#__PURE__*/_react.default.createElement("div", {
88
- "data-testid": "testDiv"
89
- }, "Div"))))));
90
- const nonGroupChild = _react2.screen.queryByTestId('testDiv');
91
- const childText = _react2.screen.queryByText('Div');
84
+ (0, _react.render)(_Drilldown || (_Drilldown = (0, _jsxRuntime.jsx)(_index.Drilldown, {
85
+ rootPageId: "page0",
86
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
87
+ id: "page0",
88
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Group, {
89
+ id: "group0",
90
+ children: (0, _jsxRuntime.jsx)("div", {
91
+ "data-testid": "testDiv",
92
+ children: "Div"
93
+ })
94
+ })
95
+ })
96
+ })));
97
+ const nonGroupChild = _react.screen.queryByTestId('testDiv');
98
+ const childText = _react.screen.queryByText('Div');
92
99
  expect(nonGroupChild).not.toBeInTheDocument();
93
100
  expect(childText).not.toBeInTheDocument();
94
101
  });
95
102
  it('elementRef should return ref to the group', async () => {
96
103
  const elementRef = _vitest.vi.fn();
97
- const _render = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
98
- rootPageId: "page0"
99
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
100
- id: "page0"
101
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
102
- id: "group0",
103
- elementRef: elementRef
104
- }, _Drilldown$Option || (_Drilldown$Option = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
105
- id: "groupOption01"
106
- }, "Option")))))),
104
+ const _render = (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
105
+ rootPageId: "page0",
106
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
107
+ id: "page0",
108
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Group, {
109
+ id: "group0",
110
+ elementRef: elementRef,
111
+ children: _Drilldown$Option || (_Drilldown$Option = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
112
+ id: "groupOption01",
113
+ children: "Option"
114
+ }))
115
+ })
116
+ })
117
+ })),
107
118
  container = _render.container;
108
119
  const group = container.querySelector('#group0');
109
120
  expect(elementRef).toHaveBeenCalledWith(group);
110
121
  });
111
122
  describe('renderGroupTitle', () => {
112
123
  it('should display', async () => {
113
- (0, _react2.render)(_Drilldown2 || (_Drilldown2 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
114
- rootPageId: "page0"
115
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
116
- id: "page0"
117
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
118
- id: "group0",
119
- renderGroupTitle: "Group Title"
120
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
121
- id: "groupOption01"
122
- }, "Option"))))));
123
- const title = _react2.screen.getByText('Group Title');
124
+ (0, _react.render)(_Drilldown2 || (_Drilldown2 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
125
+ rootPageId: "page0",
126
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
127
+ id: "page0",
128
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Group, {
129
+ id: "group0",
130
+ renderGroupTitle: "Group Title",
131
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
132
+ id: "groupOption01",
133
+ children: "Option"
134
+ })
135
+ })
136
+ })
137
+ })));
138
+ const title = _react.screen.getByText('Group Title');
124
139
  expect(title).toBeInTheDocument();
125
140
  });
126
141
  it('should display, if function is provided', async () => {
127
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
128
- rootPageId: "page0"
129
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
130
- id: "page0"
131
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
132
- id: "group0",
133
- renderGroupTitle: () => 'Group Title'
134
- }, _Drilldown$Option2 || (_Drilldown$Option2 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
135
- id: "groupOption01"
136
- }, "Option"))))));
137
- const title = _react2.screen.getByText('Group Title');
142
+ (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
143
+ rootPageId: "page0",
144
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
145
+ id: "page0",
146
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Group, {
147
+ id: "group0",
148
+ renderGroupTitle: () => 'Group Title',
149
+ children: _Drilldown$Option2 || (_Drilldown$Option2 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
150
+ id: "groupOption01",
151
+ children: "Option"
152
+ }))
153
+ })
154
+ })
155
+ }));
156
+ const title = _react.screen.getByText('Group Title');
138
157
  expect(title).toBeInTheDocument();
139
158
  });
140
159
  });
141
160
  describe('separators', () => {
142
161
  it("shouldn't display, when group is first and/or last item", async () => {
143
- const _render2 = (0, _react2.render)(_Drilldown3 || (_Drilldown3 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
144
- rootPageId: "page0"
145
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
146
- id: "page0"
147
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
148
- id: "group0"
149
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
150
- id: "groupOption01"
151
- }, "Option")))))),
162
+ const _render2 = (0, _react.render)(_Drilldown3 || (_Drilldown3 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
163
+ rootPageId: "page0",
164
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
165
+ id: "page0",
166
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Group, {
167
+ id: "group0",
168
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
169
+ id: "groupOption01",
170
+ children: "Option"
171
+ })
172
+ })
173
+ })
174
+ }))),
152
175
  container = _render2.container;
153
176
  const separators = container.querySelectorAll('[class$="-separator"]');
154
177
  expect(separators.length).toBe(0);
155
178
  });
156
179
  it('should display by default, if group is between other items', async () => {
157
- const _render3 = (0, _react2.render)(_Drilldown4 || (_Drilldown4 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
158
- rootPageId: "page0"
159
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
160
- id: "page0"
161
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
162
- id: "option1"
163
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
164
- id: "group0"
165
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
166
- id: "groupOption01"
167
- }, "Option")), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
168
- id: "option2"
169
- }, "Option"))))),
180
+ const _render3 = (0, _react.render)(_Drilldown4 || (_Drilldown4 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
181
+ rootPageId: "page0",
182
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Page, {
183
+ id: "page0",
184
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
185
+ id: "option1",
186
+ children: "Option"
187
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Group, {
188
+ id: "group0",
189
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
190
+ id: "groupOption01",
191
+ children: "Option"
192
+ })
193
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
194
+ id: "option2",
195
+ children: "Option"
196
+ })]
197
+ })
198
+ }))),
170
199
  container = _render3.container;
171
200
  const separators = container.querySelectorAll('[class$="-separator"]');
172
201
  expect(separators.length).toBe(2);
173
202
  });
174
203
  it("shouldn't display extra separator between groups", async () => {
175
- const _render4 = (0, _react2.render)(_Drilldown5 || (_Drilldown5 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
176
- rootPageId: "page0"
177
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
178
- id: "page0"
179
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
180
- id: "option1"
181
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
182
- id: "group0"
183
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
184
- id: "groupOption01"
185
- }, "Option")), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
186
- id: "group1"
187
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
188
- id: "groupOption11"
189
- }, "Option")), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
190
- id: "option2"
191
- }, "Option"))))),
204
+ const _render4 = (0, _react.render)(_Drilldown5 || (_Drilldown5 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
205
+ rootPageId: "page0",
206
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Page, {
207
+ id: "page0",
208
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
209
+ id: "option1",
210
+ children: "Option"
211
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Group, {
212
+ id: "group0",
213
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
214
+ id: "groupOption01",
215
+ children: "Option"
216
+ })
217
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Group, {
218
+ id: "group1",
219
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
220
+ id: "groupOption11",
221
+ children: "Option"
222
+ })
223
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
224
+ id: "option2",
225
+ children: "Option"
226
+ })]
227
+ })
228
+ }))),
192
229
  container = _render4.container;
193
230
  const separators = container.querySelectorAll('[class$="-separator"]');
194
231
  expect(separators.length).toBe(3);
@@ -196,22 +233,29 @@ describe('<Drilldown.Group />', () => {
196
233
  });
197
234
  describe('disabled prop', () => {
198
235
  it('should disable all items in the group', async () => {
199
- const _render5 = (0, _react2.render)(_Drilldown6 || (_Drilldown6 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
200
- rootPageId: "page0"
201
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
202
- id: "page0"
203
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
204
- id: "option1"
205
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
206
- id: "group0",
207
- disabled: true
208
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
209
- id: "groupOption01"
210
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
211
- id: "groupOption02"
212
- }, "Option")), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
213
- id: "option2"
214
- }, "Option"))))),
236
+ const _render5 = (0, _react.render)(_Drilldown6 || (_Drilldown6 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
237
+ rootPageId: "page0",
238
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Page, {
239
+ id: "page0",
240
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
241
+ id: "option1",
242
+ children: "Option"
243
+ }), (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
244
+ id: "group0",
245
+ disabled: true,
246
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
247
+ id: "groupOption01",
248
+ children: "Option"
249
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
250
+ id: "groupOption02",
251
+ children: "Option"
252
+ })]
253
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
254
+ id: "option2",
255
+ children: "Option"
256
+ })]
257
+ })
258
+ }))),
215
259
  container = _render5.container;
216
260
  const disabledOption_1 = container.querySelector('#groupOption01');
217
261
  const disabledOption_2 = container.querySelector('#groupOption02');
@@ -225,34 +269,44 @@ describe('<Drilldown.Group />', () => {
225
269
  });
226
270
  describe('role prop', () => {
227
271
  it('should be "group" by default', async () => {
228
- const _render6 = (0, _react2.render)(_Drilldown7 || (_Drilldown7 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
229
- rootPageId: "page0"
230
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
231
- id: "page0"
232
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
233
- id: "group0"
234
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
235
- id: "groupOption01"
236
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
237
- id: "groupOption02"
238
- }, "Option")))))),
272
+ const _render6 = (0, _react.render)(_Drilldown7 || (_Drilldown7 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
273
+ rootPageId: "page0",
274
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
275
+ id: "page0",
276
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
277
+ id: "group0",
278
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
279
+ id: "groupOption01",
280
+ children: "Option"
281
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
282
+ id: "groupOption02",
283
+ children: "Option"
284
+ })]
285
+ })
286
+ })
287
+ }))),
239
288
  container = _render6.container;
240
289
  const group = container.querySelector('#group0');
241
290
  expect(group).toHaveAttribute('role', 'group');
242
291
  });
243
292
  it('should render the group with passed role', async () => {
244
- const _render7 = (0, _react2.render)(_Drilldown8 || (_Drilldown8 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
245
- rootPageId: "page0"
246
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
247
- id: "page0"
248
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
249
- id: "group0",
250
- role: "menu"
251
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
252
- id: "groupOption01"
253
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
254
- id: "groupOption02"
255
- }, "Option")))))),
293
+ const _render7 = (0, _react.render)(_Drilldown8 || (_Drilldown8 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
294
+ rootPageId: "page0",
295
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
296
+ id: "page0",
297
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
298
+ id: "group0",
299
+ role: "menu",
300
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
301
+ id: "groupOption01",
302
+ children: "Option"
303
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
304
+ id: "groupOption02",
305
+ children: "Option"
306
+ })]
307
+ })
308
+ })
309
+ }))),
256
310
  container = _render7.container;
257
311
  const group = container.querySelector('#group0');
258
312
  expect(group).toHaveAttribute('role', 'menu');
@@ -260,17 +314,22 @@ describe('<Drilldown.Group />', () => {
260
314
  });
261
315
  describe('as prop', () => {
262
316
  it('should inherit Drilldown\'s "ul" by default', async () => {
263
- const _render8 = (0, _react2.render)(_Drilldown9 || (_Drilldown9 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
264
- rootPageId: "page0"
265
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
266
- id: "page0"
267
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
268
- id: "group0"
269
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
270
- id: "groupOption01"
271
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
272
- id: "groupOption02"
273
- }, "Option")))))),
317
+ const _render8 = (0, _react.render)(_Drilldown9 || (_Drilldown9 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
318
+ rootPageId: "page0",
319
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
320
+ id: "page0",
321
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
322
+ id: "group0",
323
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
324
+ id: "groupOption01",
325
+ children: "Option"
326
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
327
+ id: "groupOption02",
328
+ children: "Option"
329
+ })]
330
+ })
331
+ })
332
+ }))),
274
333
  container = _render8.container;
275
334
  const drilldownContainer = container.querySelector('[id^=Selectable_][id$=-list]');
276
335
  const group = container.querySelector('#group0');
@@ -278,18 +337,23 @@ describe('<Drilldown.Group />', () => {
278
337
  expect(group.tagName).toBe('UL');
279
338
  });
280
339
  it('should inherit Drilldown\'s "as" prop', async () => {
281
- const _render9 = (0, _react2.render)(_Drilldown10 || (_Drilldown10 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
340
+ const _render9 = (0, _react.render)(_Drilldown10 || (_Drilldown10 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
282
341
  rootPageId: "page0",
283
- as: "ol"
284
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
285
- id: "page0"
286
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
287
- id: "group0"
288
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
289
- id: "groupOption01"
290
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
291
- id: "groupOption02"
292
- }, "Option")))))),
342
+ as: "ol",
343
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
344
+ id: "page0",
345
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
346
+ id: "group0",
347
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
348
+ id: "groupOption01",
349
+ children: "Option"
350
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
351
+ id: "groupOption02",
352
+ children: "Option"
353
+ })]
354
+ })
355
+ })
356
+ }))),
293
357
  container = _render9.container;
294
358
  const drilldownContainer = container.querySelector('[id^=Selectable_][id$=-list]');
295
359
  const group = container.querySelector('#group0');
@@ -297,18 +361,23 @@ describe('<Drilldown.Group />', () => {
297
361
  expect(group.tagName).toBe('OL');
298
362
  });
299
363
  it('should render the group as other element', async () => {
300
- const _render10 = (0, _react2.render)(_Drilldown11 || (_Drilldown11 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
301
- rootPageId: "page0"
302
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
303
- id: "page0"
304
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
305
- id: "group0",
306
- as: "ol"
307
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
308
- id: "groupOption01"
309
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
310
- id: "groupOption02"
311
- }, "Option")))))),
364
+ const _render10 = (0, _react.render)(_Drilldown11 || (_Drilldown11 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
365
+ rootPageId: "page0",
366
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
367
+ id: "page0",
368
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
369
+ id: "group0",
370
+ as: "ol",
371
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
372
+ id: "groupOption01",
373
+ children: "Option"
374
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
375
+ id: "groupOption02",
376
+ children: "Option"
377
+ })]
378
+ })
379
+ })
380
+ }))),
312
381
  container = _render10.container;
313
382
  const drilldownContainer = container.querySelector('[id^=Selectable_][id$=-list]');
314
383
  const group = container.querySelector('#group0');
@@ -318,15 +387,19 @@ describe('<Drilldown.Group />', () => {
318
387
  });
319
388
  describe('selectableType', () => {
320
389
  it('if not set, should render role="menuitem" options without icon by default', async () => {
321
- const _render11 = (0, _react2.render)(_Drilldown12 || (_Drilldown12 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
322
- rootPageId: "page0"
323
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
324
- id: "page0"
325
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
326
- id: "group0"
327
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
328
- id: "groupOption01"
329
- }, "Option")))))),
390
+ const _render11 = (0, _react.render)(_Drilldown12 || (_Drilldown12 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
391
+ rootPageId: "page0",
392
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
393
+ id: "page0",
394
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Group, {
395
+ id: "group0",
396
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
397
+ id: "groupOption01",
398
+ children: "Option"
399
+ })
400
+ })
401
+ })
402
+ }))),
330
403
  container = _render11.container;
331
404
  const icon = container.querySelector('svg[name="IconCheck"]');
332
405
  const groupOption = container.querySelector('#groupOption01');
@@ -334,16 +407,20 @@ describe('<Drilldown.Group />', () => {
334
407
  expect(groupOption).toHaveAttribute('role', 'menuitem');
335
408
  });
336
409
  it('value "single" should render role="menuitemradio" options with icon', async () => {
337
- const _render12 = (0, _react2.render)(_Drilldown13 || (_Drilldown13 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
338
- rootPageId: "page0"
339
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
340
- id: "page0"
341
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
342
- id: "group0",
343
- selectableType: "single"
344
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
345
- id: "groupOption01"
346
- }, "Option")))))),
410
+ const _render12 = (0, _react.render)(_Drilldown13 || (_Drilldown13 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
411
+ rootPageId: "page0",
412
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
413
+ id: "page0",
414
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Group, {
415
+ id: "group0",
416
+ selectableType: "single",
417
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
418
+ id: "groupOption01",
419
+ children: "Option"
420
+ })
421
+ })
422
+ })
423
+ }))),
347
424
  container = _render12.container;
348
425
  const icon = container.querySelector('svg[name="IconCheck"]');
349
426
  const groupOption = container.querySelector('#groupOption01');
@@ -351,16 +428,20 @@ describe('<Drilldown.Group />', () => {
351
428
  expect(groupOption).toHaveAttribute('role', 'menuitemradio');
352
429
  });
353
430
  it('value "multiple" should render role="menuitemcheckbox" options with icon', async () => {
354
- const _render13 = (0, _react2.render)(_Drilldown14 || (_Drilldown14 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
355
- rootPageId: "page0"
356
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
357
- id: "page0"
358
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
359
- id: "group0",
360
- selectableType: "multiple"
361
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
362
- id: "groupOption01"
363
- }, "Option")))))),
431
+ const _render13 = (0, _react.render)(_Drilldown14 || (_Drilldown14 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
432
+ rootPageId: "page0",
433
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
434
+ id: "page0",
435
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Group, {
436
+ id: "group0",
437
+ selectableType: "multiple",
438
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
439
+ id: "groupOption01",
440
+ children: "Option"
441
+ })
442
+ })
443
+ })
444
+ }))),
364
445
  container = _render13.container;
365
446
  const icon = container.querySelector('svg[name="IconCheck"]');
366
447
  const groupOption = container.querySelector('#groupOption01');
@@ -371,47 +452,59 @@ describe('<Drilldown.Group />', () => {
371
452
  describe('defaultSelected', () => {
372
453
  describe('if not provided', () => {
373
454
  it('all group options has to be unselected', async () => {
374
- (0, _react2.render)(_Drilldown15 || (_Drilldown15 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
375
- rootPageId: "page0"
376
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
377
- id: "page0"
378
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
379
- id: "group0",
380
- selectableType: "multiple"
381
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
382
- id: "groupOption01",
383
- value: 1
384
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
385
- id: "groupOption02",
386
- value: 2
387
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
388
- id: "groupOption03",
389
- value: 3
390
- }, "Option"))))));
391
- const options = _react2.screen.getAllByRole('menuitemcheckbox');
455
+ (0, _react.render)(_Drilldown15 || (_Drilldown15 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
456
+ rootPageId: "page0",
457
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
458
+ id: "page0",
459
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
460
+ id: "group0",
461
+ selectableType: "multiple",
462
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
463
+ id: "groupOption01",
464
+ value: 1,
465
+ children: "Option"
466
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
467
+ id: "groupOption02",
468
+ value: 2,
469
+ children: "Option"
470
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
471
+ id: "groupOption03",
472
+ value: 3,
473
+ children: "Option"
474
+ })]
475
+ })
476
+ })
477
+ })));
478
+ const options = _react.screen.getAllByRole('menuitemcheckbox');
392
479
  expect(options.length).toBe(3);
393
480
  options.forEach(option => {
394
481
  expect(option).toHaveAttribute('aria-checked', 'false');
395
482
  });
396
483
  });
397
484
  it('all checkboxes should not be visible', async () => {
398
- const _render14 = (0, _react2.render)(_Drilldown16 || (_Drilldown16 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
399
- rootPageId: "page0"
400
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
401
- id: "page0"
402
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
403
- id: "group0",
404
- selectableType: "multiple"
405
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
406
- id: "groupOption01",
407
- value: 1
408
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
409
- id: "groupOption02",
410
- value: 2
411
- }, "Option"), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
412
- id: "groupOption03",
413
- value: 3
414
- }, "Option")))))),
485
+ const _render14 = (0, _react.render)(_Drilldown16 || (_Drilldown16 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
486
+ rootPageId: "page0",
487
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
488
+ id: "page0",
489
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
490
+ id: "group0",
491
+ selectableType: "multiple",
492
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
493
+ id: "groupOption01",
494
+ value: 1,
495
+ children: "Option"
496
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
497
+ id: "groupOption02",
498
+ value: 2,
499
+ children: "Option"
500
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
501
+ id: "groupOption03",
502
+ value: 3,
503
+ children: "Option"
504
+ })]
505
+ })
506
+ })
507
+ }))),
415
508
  container = _render14.container;
416
509
  const icons = container.querySelectorAll('svg[name="IconCheck"]');
417
510
  expect(icons.length).toBe(3);
@@ -423,26 +516,32 @@ describe('<Drilldown.Group />', () => {
423
516
  describe('if provided', () => {
424
517
  it('all selected checkboxes should be visible', async () => {
425
518
  const selectedValues = ['item1', 'item3'];
426
- const _render15 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
427
- rootPageId: "page0"
428
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
429
- id: "page0"
430
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
431
- id: "group0",
432
- selectableType: "multiple",
433
- defaultSelected: selectedValues
434
- }, _Drilldown$Option3 || (_Drilldown$Option3 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
435
- id: "groupOption01",
436
- value: "item1"
437
- }, "Option")), _Drilldown$Option4 || (_Drilldown$Option4 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
438
- id: "groupOption02",
439
- value: "item2"
440
- }, "Option")), _Drilldown$Option5 || (_Drilldown$Option5 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
441
- id: "groupOption03",
442
- value: "item3"
443
- }, "Option")))))),
519
+ const _render15 = (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
520
+ rootPageId: "page0",
521
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
522
+ id: "page0",
523
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
524
+ id: "group0",
525
+ selectableType: "multiple",
526
+ defaultSelected: selectedValues,
527
+ children: [_Drilldown$Option3 || (_Drilldown$Option3 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
528
+ id: "groupOption01",
529
+ value: "item1",
530
+ children: "Option"
531
+ })), _Drilldown$Option4 || (_Drilldown$Option4 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
532
+ id: "groupOption02",
533
+ value: "item2",
534
+ children: "Option"
535
+ })), _Drilldown$Option5 || (_Drilldown$Option5 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
536
+ id: "groupOption03",
537
+ value: "item3",
538
+ children: "Option"
539
+ }))]
540
+ })
541
+ })
542
+ })),
444
543
  container = _render15.container;
445
- const options = _react2.screen.getAllByRole('menuitemcheckbox');
544
+ const options = _react.screen.getAllByRole('menuitemcheckbox');
446
545
  const icons = container.querySelectorAll('svg');
447
546
  expect(options[0]).toHaveAttribute('aria-checked', 'true');
448
547
  expect(options[1]).toHaveAttribute('aria-checked', 'false');
@@ -453,27 +552,33 @@ describe('<Drilldown.Group />', () => {
453
552
  });
454
553
  it("should be overridden by the Option's own defaultSelected", async () => {
455
554
  const selectedValues = ['item1', 'item3'];
456
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
457
- rootPageId: "page0"
458
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
459
- id: "page0"
460
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
461
- id: "group0",
462
- selectableType: "multiple",
463
- defaultSelected: selectedValues
464
- }, _Drilldown$Option6 || (_Drilldown$Option6 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
465
- id: "groupOption01",
466
- value: "item1"
467
- }, "Option")), _Drilldown$Option7 || (_Drilldown$Option7 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
468
- id: "groupOption02",
469
- value: "item2",
470
- defaultSelected: true
471
- }, "Option")), _Drilldown$Option8 || (_Drilldown$Option8 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
472
- id: "groupOption03",
473
- value: "item3",
474
- defaultSelected: false
475
- }, "Option"))))));
476
- const options = _react2.screen.getAllByRole('menuitemcheckbox');
555
+ (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
556
+ rootPageId: "page0",
557
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
558
+ id: "page0",
559
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
560
+ id: "group0",
561
+ selectableType: "multiple",
562
+ defaultSelected: selectedValues,
563
+ children: [_Drilldown$Option6 || (_Drilldown$Option6 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
564
+ id: "groupOption01",
565
+ value: "item1",
566
+ children: "Option"
567
+ })), _Drilldown$Option7 || (_Drilldown$Option7 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
568
+ id: "groupOption02",
569
+ value: "item2",
570
+ defaultSelected: true,
571
+ children: "Option"
572
+ })), _Drilldown$Option8 || (_Drilldown$Option8 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
573
+ id: "groupOption03",
574
+ value: "item3",
575
+ defaultSelected: false,
576
+ children: "Option"
577
+ }))]
578
+ })
579
+ })
580
+ }));
581
+ const options = _react.screen.getAllByRole('menuitemcheckbox');
477
582
  expect(options[0]).toHaveAttribute('aria-checked', 'true'); // from the group,
478
583
  expect(options[1]).toHaveAttribute('aria-checked', 'true'); // from own prop,
479
584
  expect(options[2]).toHaveAttribute('aria-checked', 'false'); // override group's
@@ -481,50 +586,62 @@ describe('<Drilldown.Group />', () => {
481
586
  describe('for "single" selectableType', () => {
482
587
  it('the selected option should be checked', async () => {
483
588
  const selectedValues = ['item2'];
484
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
485
- rootPageId: "page0"
486
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
487
- id: "page0"
488
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
489
- id: "group0",
490
- selectableType: "single",
491
- defaultSelected: selectedValues
492
- }, _Drilldown$Option9 || (_Drilldown$Option9 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
493
- id: "groupOption01",
494
- value: "item1"
495
- }, "Option")), _Drilldown$Option10 || (_Drilldown$Option10 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
496
- id: "groupOption02",
497
- value: "item2"
498
- }, "Option")), _Drilldown$Option11 || (_Drilldown$Option11 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
499
- id: "groupOption03",
500
- value: "item3"
501
- }, "Option"))))));
502
- const options = _react2.screen.getAllByRole('menuitemradio');
589
+ (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
590
+ rootPageId: "page0",
591
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
592
+ id: "page0",
593
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
594
+ id: "group0",
595
+ selectableType: "single",
596
+ defaultSelected: selectedValues,
597
+ children: [_Drilldown$Option9 || (_Drilldown$Option9 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
598
+ id: "groupOption01",
599
+ value: "item1",
600
+ children: "Option"
601
+ })), _Drilldown$Option10 || (_Drilldown$Option10 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
602
+ id: "groupOption02",
603
+ value: "item2",
604
+ children: "Option"
605
+ })), _Drilldown$Option11 || (_Drilldown$Option11 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
606
+ id: "groupOption03",
607
+ value: "item3",
608
+ children: "Option"
609
+ }))]
610
+ })
611
+ })
612
+ }));
613
+ const options = _react.screen.getAllByRole('menuitemradio');
503
614
  expect(options[0]).toHaveAttribute('aria-checked', 'false');
504
615
  expect(options[1]).toHaveAttribute('aria-checked', 'true');
505
616
  expect(options[2]).toHaveAttribute('aria-checked', 'false');
506
617
  });
507
618
  it("should throw error if multiple items are selected, and shouldn't select any item", async () => {
508
619
  const selectedValues = ['item1', 'item3'];
509
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
510
- rootPageId: "page0"
511
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
512
- id: "page0"
513
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
514
- id: "group0",
515
- selectableType: "single",
516
- defaultSelected: selectedValues
517
- }, _Drilldown$Option12 || (_Drilldown$Option12 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
518
- id: "groupOption01",
519
- value: "item1"
520
- }, "Option")), _Drilldown$Option13 || (_Drilldown$Option13 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
521
- id: "groupOption02",
522
- value: "item2"
523
- }, "Option")), _Drilldown$Option14 || (_Drilldown$Option14 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
524
- id: "groupOption03",
525
- value: "item3"
526
- }, "Option"))))));
527
- const options = _react2.screen.getAllByRole('menuitemradio');
620
+ (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
621
+ rootPageId: "page0",
622
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
623
+ id: "page0",
624
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
625
+ id: "group0",
626
+ selectableType: "single",
627
+ defaultSelected: selectedValues,
628
+ children: [_Drilldown$Option12 || (_Drilldown$Option12 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
629
+ id: "groupOption01",
630
+ value: "item1",
631
+ children: "Option"
632
+ })), _Drilldown$Option13 || (_Drilldown$Option13 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
633
+ id: "groupOption02",
634
+ value: "item2",
635
+ children: "Option"
636
+ })), _Drilldown$Option14 || (_Drilldown$Option14 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
637
+ id: "groupOption03",
638
+ value: "item3",
639
+ children: "Option"
640
+ }))]
641
+ })
642
+ })
643
+ }));
644
+ const options = _react.screen.getAllByRole('menuitemradio');
528
645
  expect(options[0]).toHaveAttribute('aria-checked', 'false');
529
646
  expect(options[1]).toHaveAttribute('aria-checked', 'false');
530
647
  expect(options[2]).toHaveAttribute('aria-checked', 'false');
@@ -536,27 +653,33 @@ describe('<Drilldown.Group />', () => {
536
653
  describe('selection', () => {
537
654
  it('should fire "onSelect" callback', async () => {
538
655
  const onSelect = _vitest.vi.fn();
539
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
540
- rootPageId: "page0"
541
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
542
- id: "page0"
543
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Group, {
544
- id: "group0",
545
- selectableType: "multiple",
546
- onSelect: onSelect
547
- }, _Drilldown$Option15 || (_Drilldown$Option15 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
548
- id: "groupOption01",
549
- value: "item1"
550
- }, "Option 1")), _Drilldown$Option16 || (_Drilldown$Option16 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
551
- id: "groupOption02",
552
- value: "item2"
553
- }, "Option 2")), _Drilldown$Option17 || (_Drilldown$Option17 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
554
- id: "groupOption03",
555
- value: "item3"
556
- }, "Option 3"))))));
557
- const option2 = _react2.screen.getByText('Option 2');
656
+ (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
657
+ rootPageId: "page0",
658
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
659
+ id: "page0",
660
+ children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
661
+ id: "group0",
662
+ selectableType: "multiple",
663
+ onSelect: onSelect,
664
+ children: [_Drilldown$Option15 || (_Drilldown$Option15 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
665
+ id: "groupOption01",
666
+ value: "item1",
667
+ children: "Option 1"
668
+ })), _Drilldown$Option16 || (_Drilldown$Option16 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
669
+ id: "groupOption02",
670
+ value: "item2",
671
+ children: "Option 2"
672
+ })), _Drilldown$Option17 || (_Drilldown$Option17 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
673
+ id: "groupOption03",
674
+ value: "item3",
675
+ children: "Option 3"
676
+ }))]
677
+ })
678
+ })
679
+ }));
680
+ const option2 = _react.screen.getByText('Option 2');
558
681
  await _userEvent.default.click(option2);
559
- await (0, _react2.waitFor)(() => {
682
+ await (0, _react.waitFor)(() => {
560
683
  expect(onSelect).toHaveBeenCalledTimes(1);
561
684
  const args = onSelect.mock.calls[0][1];
562
685
  const event = onSelect.mock.calls[0][0];