@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.
- package/CHANGELOG.md +1 -1
- package/es/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.js +448 -325
- package/es/Drilldown/DrilldownGroup/index.js +0 -1
- package/es/Drilldown/DrilldownOption/__new-tests__/DrilldownOption.test.js +422 -309
- package/es/Drilldown/DrilldownOption/index.js +0 -1
- package/es/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.js +201 -147
- package/es/Drilldown/DrilldownPage/index.js +0 -1
- package/es/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.js +22 -17
- package/es/Drilldown/DrilldownSeparator/index.js +0 -1
- package/es/Drilldown/__examples__/Drilldown.examples.js +99 -82
- package/es/Drilldown/__new-tests__/Drilldown.test.js +533 -352
- package/es/Drilldown/index.js +144 -126
- package/lib/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.js +463 -340
- package/lib/Drilldown/DrilldownGroup/index.js +0 -1
- package/lib/Drilldown/DrilldownOption/__new-tests__/DrilldownOption.test.js +448 -336
- package/lib/Drilldown/DrilldownOption/index.js +0 -1
- package/lib/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.js +221 -167
- package/lib/Drilldown/DrilldownPage/index.js +0 -2
- package/lib/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.js +25 -21
- package/lib/Drilldown/DrilldownSeparator/index.js +0 -1
- package/lib/Drilldown/__examples__/Drilldown.examples.js +99 -83
- package/lib/Drilldown/__new-tests__/Drilldown.test.js +568 -387
- package/lib/Drilldown/index.js +143 -126
- package/package.json +21 -21
- package/src/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.tsx +0 -1
- package/src/Drilldown/DrilldownGroup/index.tsx +0 -1
- package/src/Drilldown/DrilldownOption/__new-tests__/DrilldownOption.test.tsx +1 -1
- package/src/Drilldown/DrilldownOption/index.tsx +0 -1
- package/src/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.tsx +0 -1
- package/src/Drilldown/DrilldownPage/index.tsx +0 -1
- package/src/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.tsx +0 -1
- package/src/Drilldown/DrilldownSeparator/index.tsx +0 -1
- package/src/Drilldown/__examples__/Drilldown.examples.tsx +0 -2
- package/src/Drilldown/__new-tests__/Drilldown.test.tsx +0 -1
- package/src/Drilldown/index.tsx +4 -6
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.d.ts.map +1 -1
- package/types/Drilldown/DrilldownGroup/index.d.ts +0 -1
- package/types/Drilldown/DrilldownGroup/index.d.ts.map +1 -1
- package/types/Drilldown/DrilldownOption/index.d.ts +0 -1
- package/types/Drilldown/DrilldownOption/index.d.ts.map +1 -1
- package/types/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.d.ts.map +1 -1
- package/types/Drilldown/DrilldownPage/index.d.ts +0 -1
- package/types/Drilldown/DrilldownPage/index.d.ts.map +1 -1
- package/types/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.d.ts.map +1 -1
- package/types/Drilldown/DrilldownSeparator/index.d.ts +0 -1
- package/types/Drilldown/DrilldownSeparator/index.d.ts.map +1 -1
- package/types/Drilldown/__examples__/Drilldown.examples.d.ts.map +1 -1
- package/types/Drilldown/__new-tests__/Drilldown.test.d.ts.map +1 -1
- package/types/Drilldown/index.d.ts +7 -10
- package/types/Drilldown/index.d.ts.map +1 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _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");
|
|
@@ -11,6 +10,7 @@ var _runAxeCheck = require("@instructure/ui-axe-check/lib/runAxeCheck.js");
|
|
|
11
10
|
var _IconCheckSolid = require("@instructure/ui-icons/lib/IconCheckSolid.js");
|
|
12
11
|
var _index = require("../index");
|
|
13
12
|
var _Drilldown16 = _interopRequireDefault(require("../__examples__/Drilldown.examples"));
|
|
13
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
14
14
|
var _Drilldown, _Drilldown2, _Drilldown3, _Drilldown4, _Drilldown5, _Drilldown6, _Drilldown7, _Drilldown8, _Drilldown9, _Drilldown$Page, _button, _Drilldown$Page2, _button2, _Drilldown$Page3, _Drilldown$Page4, _button3, _Drilldown$Page5, _button4, _Drilldown$Page6, _Drilldown$Page7, _button5, _Drilldown$Page8, _button6, _Drilldown$Page9, _Drilldown10, _button7, _Drilldown$Page10, _Drilldown11, _button8, _Drilldown$Page11, _button9, _Drilldown$Page12, _button10, _Drilldown$Page13, _Drilldown12, _button11, _Drilldown$Page14, _Drilldown13, _button12, _Drilldown$Page15, _button13, _Drilldown$Page16, _button14, _Drilldown$Page17, _button15, _Drilldown$Page18, _button16, _Drilldown$Page19, _button17, _Drilldown$Page20, _button18, _Drilldown$Page21, _button19, _Drilldown$Page22, _Drilldown14, _Drilldown15;
|
|
15
15
|
/*
|
|
16
16
|
* The MIT License (MIT)
|
|
@@ -54,20 +54,25 @@ describe('<Drilldown />', () => {
|
|
|
54
54
|
});
|
|
55
55
|
describe('rootPageId prop', () => {
|
|
56
56
|
it('should set the initial page and render it', async () => {
|
|
57
|
-
(0,
|
|
58
|
-
rootPageId: "page1"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
(0, _react.render)(_Drilldown || (_Drilldown = (0, _jsxRuntime.jsxs)(_index.Drilldown, {
|
|
58
|
+
rootPageId: "page1",
|
|
59
|
+
children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
60
|
+
id: "page0",
|
|
61
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
62
|
+
id: "option01",
|
|
63
|
+
children: "Option-01"
|
|
64
|
+
})
|
|
65
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
66
|
+
id: "page1",
|
|
67
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
68
|
+
id: "option11",
|
|
69
|
+
children: "Option-11"
|
|
70
|
+
})
|
|
71
|
+
})]
|
|
72
|
+
})));
|
|
73
|
+
const drilldown = _react.screen.getByRole('menu');
|
|
74
|
+
const options = _react.screen.getAllByRole('menuitem');
|
|
75
|
+
const rootlessOption = _react.screen.queryByText('Option-01');
|
|
71
76
|
expect(drilldown).toBeInTheDocument();
|
|
72
77
|
expect(rootlessOption).not.toBeInTheDocument();
|
|
73
78
|
expect(options.length).toBe(1);
|
|
@@ -77,14 +82,16 @@ describe('<Drilldown />', () => {
|
|
|
77
82
|
});
|
|
78
83
|
describe('children prop', () => {
|
|
79
84
|
it('should not allow non-DrilldownPage children', async () => {
|
|
80
|
-
(0,
|
|
81
|
-
rootPageId: "page0"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const
|
|
85
|
+
(0, _react.render)(_Drilldown2 || (_Drilldown2 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
86
|
+
rootPageId: "page0",
|
|
87
|
+
children: (0, _jsxRuntime.jsx)("div", {
|
|
88
|
+
id: "testDiv",
|
|
89
|
+
children: "DIV-child"
|
|
90
|
+
})
|
|
91
|
+
})));
|
|
92
|
+
const drilldown = _react.screen.queryByRole('menu');
|
|
93
|
+
const options = _react.screen.queryAllByRole('menuitem');
|
|
94
|
+
const notAllowedChild = _react.screen.queryByText('DIV-child');
|
|
88
95
|
expect(drilldown).not.toBeInTheDocument();
|
|
89
96
|
expect(options.length).toBe(0);
|
|
90
97
|
expect(notAllowedChild).not.toBeInTheDocument();
|
|
@@ -92,50 +99,61 @@ describe('<Drilldown />', () => {
|
|
|
92
99
|
});
|
|
93
100
|
describe('id prop', () => {
|
|
94
101
|
it('should put id attr on the drilldown', async () => {
|
|
95
|
-
(0,
|
|
102
|
+
(0, _react.render)(_Drilldown3 || (_Drilldown3 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
96
103
|
rootPageId: "page0",
|
|
97
|
-
id: "testId"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
id: "testId",
|
|
105
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
106
|
+
id: "page0",
|
|
107
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
108
|
+
id: "option01",
|
|
109
|
+
children: "Option"
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
})));
|
|
113
|
+
const drilldown = _react.screen.getByRole('menu');
|
|
104
114
|
expect(drilldown).toBeInTheDocument();
|
|
105
115
|
expect(drilldown).toHaveAttribute('id', 'testId');
|
|
106
116
|
});
|
|
107
117
|
});
|
|
108
118
|
describe('label prop', () => {
|
|
109
119
|
it('should be added as aria-label', async () => {
|
|
110
|
-
(0,
|
|
120
|
+
(0, _react.render)(_Drilldown4 || (_Drilldown4 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
111
121
|
rootPageId: "page0",
|
|
112
|
-
label: "testLabel"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
label: "testLabel",
|
|
123
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
124
|
+
id: "page0",
|
|
125
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
126
|
+
id: "option01",
|
|
127
|
+
children: "Option"
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
})));
|
|
131
|
+
const drilldown = _react.screen.getByRole('menu');
|
|
119
132
|
expect(drilldown).toBeInTheDocument();
|
|
120
133
|
expect(drilldown).toHaveAttribute('aria-label', 'testLabel');
|
|
121
134
|
});
|
|
122
135
|
});
|
|
123
136
|
describe('disabled prop', () => {
|
|
124
137
|
it('should disable all options', async () => {
|
|
125
|
-
(0,
|
|
138
|
+
(0, _react.render)(_Drilldown5 || (_Drilldown5 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
126
139
|
rootPageId: "page0",
|
|
127
|
-
disabled: true
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
disabled: true,
|
|
141
|
+
children: (0, _jsxRuntime.jsxs)(_index.Drilldown.Page, {
|
|
142
|
+
id: "page0",
|
|
143
|
+
renderActionLabel: "Action",
|
|
144
|
+
children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
145
|
+
id: "option01",
|
|
146
|
+
children: "Option"
|
|
147
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
148
|
+
id: "option02",
|
|
149
|
+
children: "Option"
|
|
150
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
151
|
+
id: "option03",
|
|
152
|
+
children: "Option"
|
|
153
|
+
})]
|
|
154
|
+
})
|
|
155
|
+
})));
|
|
156
|
+
const options = _react.screen.getAllByRole('menuitem');
|
|
139
157
|
expect(options.length).toBe(4); // header action + 3 options
|
|
140
158
|
|
|
141
159
|
options.forEach(option => {
|
|
@@ -145,26 +163,32 @@ describe('<Drilldown />', () => {
|
|
|
145
163
|
});
|
|
146
164
|
describe('as prop', () => {
|
|
147
165
|
it('should be "ul" by default', async () => {
|
|
148
|
-
const _render = (0,
|
|
149
|
-
rootPageId: "page0"
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
166
|
+
const _render = (0, _react.render)(_Drilldown6 || (_Drilldown6 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
167
|
+
rootPageId: "page0",
|
|
168
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
169
|
+
id: "page0",
|
|
170
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
171
|
+
id: "option01",
|
|
172
|
+
children: "Option"
|
|
173
|
+
})
|
|
174
|
+
})
|
|
175
|
+
}))),
|
|
155
176
|
container = _render.container;
|
|
156
177
|
const drilldownList = container.querySelector('[class$="-options__list"]');
|
|
157
178
|
expect(drilldownList === null || drilldownList === void 0 ? void 0 : drilldownList.tagName).toBe('UL');
|
|
158
179
|
});
|
|
159
180
|
it('should render as passed element', async () => {
|
|
160
|
-
const _render2 = (0,
|
|
181
|
+
const _render2 = (0, _react.render)(_Drilldown7 || (_Drilldown7 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
161
182
|
rootPageId: "page0",
|
|
162
|
-
as: "ol"
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
183
|
+
as: "ol",
|
|
184
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
185
|
+
id: "page0",
|
|
186
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
187
|
+
id: "option01",
|
|
188
|
+
children: "Option"
|
|
189
|
+
})
|
|
190
|
+
})
|
|
191
|
+
}))),
|
|
168
192
|
container = _render2.container;
|
|
169
193
|
const drilldownList = container.querySelector('[class$="-options__list"]');
|
|
170
194
|
expect(drilldownList === null || drilldownList === void 0 ? void 0 : drilldownList.tagName).toBe('OL');
|
|
@@ -172,26 +196,32 @@ describe('<Drilldown />', () => {
|
|
|
172
196
|
});
|
|
173
197
|
describe('role prop', () => {
|
|
174
198
|
it('should be "menu" by default', async () => {
|
|
175
|
-
const _render3 = (0,
|
|
176
|
-
rootPageId: "page0"
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
199
|
+
const _render3 = (0, _react.render)(_Drilldown8 || (_Drilldown8 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
200
|
+
rootPageId: "page0",
|
|
201
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
202
|
+
id: "page0",
|
|
203
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
204
|
+
id: "option01",
|
|
205
|
+
children: "Option"
|
|
206
|
+
})
|
|
207
|
+
})
|
|
208
|
+
}))),
|
|
182
209
|
container = _render3.container;
|
|
183
210
|
const drilldown = container.querySelector('div[id^="Drilldown_"]');
|
|
184
211
|
expect(drilldown).toHaveAttribute('role', 'menu');
|
|
185
212
|
});
|
|
186
213
|
it('should apply passed role', async () => {
|
|
187
|
-
const _render4 = (0,
|
|
214
|
+
const _render4 = (0, _react.render)(_Drilldown9 || (_Drilldown9 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
188
215
|
rootPageId: "page0",
|
|
189
|
-
role: "list"
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
216
|
+
role: "list",
|
|
217
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
218
|
+
id: "page0",
|
|
219
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
220
|
+
id: "option01",
|
|
221
|
+
children: "Option"
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
}))),
|
|
195
225
|
container = _render4.container;
|
|
196
226
|
const drilldown = container.querySelector('div[id^="Drilldown_"]');
|
|
197
227
|
expect(drilldown).toHaveAttribute('role', 'list');
|
|
@@ -200,31 +230,39 @@ describe('<Drilldown />', () => {
|
|
|
200
230
|
describe('elementRef prop (and ref static prop)', () => {
|
|
201
231
|
it('should give back the drilldown element when there is no trigger', async () => {
|
|
202
232
|
const elementRef = _vitest.vi.fn();
|
|
203
|
-
(0,
|
|
233
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
204
234
|
rootPageId: "page0",
|
|
205
|
-
elementRef: elementRef
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
235
|
+
elementRef: elementRef,
|
|
236
|
+
children: _Drilldown$Page || (_Drilldown$Page = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
237
|
+
id: "page0",
|
|
238
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
239
|
+
id: "option01",
|
|
240
|
+
children: "Option"
|
|
241
|
+
})
|
|
242
|
+
}))
|
|
243
|
+
}));
|
|
244
|
+
const drilldown = _react.screen.getByRole('menu');
|
|
212
245
|
expect(drilldown).toBeInTheDocument();
|
|
213
246
|
expect(elementRef).toHaveBeenCalledWith(drilldown);
|
|
214
247
|
});
|
|
215
248
|
it('should give back the Popover root when drilldown has trigger and is closed', async () => {
|
|
216
249
|
const elementRef = _vitest.vi.fn();
|
|
217
|
-
const _render5 = (0,
|
|
250
|
+
const _render5 = (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
218
251
|
rootPageId: "page0",
|
|
219
252
|
elementRef: elementRef,
|
|
220
|
-
trigger: _button || (_button =
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
253
|
+
trigger: _button || (_button = (0, _jsxRuntime.jsx)("button", {
|
|
254
|
+
children: "Toggle"
|
|
255
|
+
})),
|
|
256
|
+
children: _Drilldown$Page2 || (_Drilldown$Page2 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
257
|
+
id: "page0",
|
|
258
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
259
|
+
id: "option01",
|
|
260
|
+
children: "Option"
|
|
261
|
+
})
|
|
262
|
+
}))
|
|
263
|
+
})),
|
|
226
264
|
container = _render5.container;
|
|
227
|
-
const trigger =
|
|
265
|
+
const trigger = _react.screen.getByText('Toggle');
|
|
228
266
|
const positionId = trigger.getAttribute('data-position-target');
|
|
229
267
|
const drilldownRoot = container.querySelector(`span[data-position="${positionId}"]`);
|
|
230
268
|
expect(drilldownRoot).toBeInTheDocument();
|
|
@@ -232,18 +270,23 @@ describe('<Drilldown />', () => {
|
|
|
232
270
|
});
|
|
233
271
|
it('should give back the the Popover root when drilldown has trigger and is open', async () => {
|
|
234
272
|
const elementRef = _vitest.vi.fn();
|
|
235
|
-
const _render6 = (0,
|
|
273
|
+
const _render6 = (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
236
274
|
rootPageId: "page0",
|
|
237
275
|
elementRef: elementRef,
|
|
238
|
-
trigger: _button2 || (_button2 =
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
276
|
+
trigger: _button2 || (_button2 = (0, _jsxRuntime.jsx)("button", {
|
|
277
|
+
children: "Toggle"
|
|
278
|
+
})),
|
|
279
|
+
defaultShow: true,
|
|
280
|
+
children: _Drilldown$Page3 || (_Drilldown$Page3 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
281
|
+
id: "page0",
|
|
282
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
283
|
+
id: "option01",
|
|
284
|
+
children: "Option"
|
|
285
|
+
})
|
|
286
|
+
}))
|
|
287
|
+
})),
|
|
245
288
|
container = _render6.container;
|
|
246
|
-
const trigger =
|
|
289
|
+
const trigger = _react.screen.getByText('Toggle');
|
|
247
290
|
const positionId = trigger.getAttribute('data-position-target');
|
|
248
291
|
const drilldownRoot = container.querySelector(`span[data-position="${positionId}"]`);
|
|
249
292
|
expect(drilldownRoot).toBeInTheDocument();
|
|
@@ -253,72 +296,93 @@ describe('<Drilldown />', () => {
|
|
|
253
296
|
describe('drilldownRef prop', () => {
|
|
254
297
|
it('should give back the drilldown element when there is no trigger', async () => {
|
|
255
298
|
const drilldownRef = _vitest.vi.fn();
|
|
256
|
-
(0,
|
|
299
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
257
300
|
rootPageId: "page0",
|
|
258
|
-
drilldownRef: drilldownRef
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
301
|
+
drilldownRef: drilldownRef,
|
|
302
|
+
children: _Drilldown$Page4 || (_Drilldown$Page4 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
303
|
+
id: "page0",
|
|
304
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
305
|
+
id: "option01",
|
|
306
|
+
children: "Option"
|
|
307
|
+
})
|
|
308
|
+
}))
|
|
309
|
+
}));
|
|
310
|
+
const drilldown = _react.screen.getByRole('menu');
|
|
265
311
|
expect(drilldownRef).toHaveBeenCalledWith(drilldown);
|
|
266
312
|
});
|
|
267
313
|
it("shouldn't be called when drilldown has trigger and is closed", async () => {
|
|
268
314
|
const drilldownRef = _vitest.vi.fn();
|
|
269
|
-
(0,
|
|
315
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
270
316
|
rootPageId: "page0",
|
|
271
317
|
drilldownRef: drilldownRef,
|
|
272
|
-
trigger: _button3 || (_button3 =
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
318
|
+
trigger: _button3 || (_button3 = (0, _jsxRuntime.jsx)("button", {
|
|
319
|
+
children: "Toggle"
|
|
320
|
+
})),
|
|
321
|
+
children: _Drilldown$Page5 || (_Drilldown$Page5 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
322
|
+
id: "page0",
|
|
323
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
324
|
+
id: "option01",
|
|
325
|
+
children: "Option"
|
|
326
|
+
})
|
|
327
|
+
}))
|
|
328
|
+
}));
|
|
278
329
|
expect(drilldownRef).not.toHaveBeenCalled();
|
|
279
330
|
});
|
|
280
331
|
it('should give back the drilldown element when drilldown has trigger and is open', async () => {
|
|
281
332
|
const drilldownRef = _vitest.vi.fn();
|
|
282
|
-
(0,
|
|
333
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
283
334
|
rootPageId: "page0",
|
|
284
335
|
drilldownRef: drilldownRef,
|
|
285
|
-
trigger: _button4 || (_button4 =
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
336
|
+
trigger: _button4 || (_button4 = (0, _jsxRuntime.jsx)("button", {
|
|
337
|
+
children: "Toggle"
|
|
338
|
+
})),
|
|
339
|
+
defaultShow: true,
|
|
340
|
+
children: _Drilldown$Page6 || (_Drilldown$Page6 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
341
|
+
id: "page0",
|
|
342
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
343
|
+
id: "option01",
|
|
344
|
+
children: "Option"
|
|
345
|
+
})
|
|
346
|
+
}))
|
|
347
|
+
}));
|
|
348
|
+
const drilldown = _react.screen.getByRole('menu');
|
|
293
349
|
expect(drilldownRef).toHaveBeenCalledWith(drilldown);
|
|
294
350
|
});
|
|
295
351
|
});
|
|
296
352
|
describe('popoverRef prop', () => {
|
|
297
353
|
it('should not be called when there is no trigger', async () => {
|
|
298
354
|
const popoverRef = _vitest.vi.fn();
|
|
299
|
-
(0,
|
|
355
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
300
356
|
rootPageId: "page0",
|
|
301
|
-
popoverRef: popoverRef
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
357
|
+
popoverRef: popoverRef,
|
|
358
|
+
children: _Drilldown$Page7 || (_Drilldown$Page7 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
359
|
+
id: "page0",
|
|
360
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
361
|
+
id: "option01",
|
|
362
|
+
children: "Option"
|
|
363
|
+
})
|
|
364
|
+
}))
|
|
365
|
+
}));
|
|
307
366
|
expect(popoverRef).not.toHaveBeenCalled();
|
|
308
367
|
});
|
|
309
368
|
it('should give back the Popover component when drilldown has trigger and is closed', async () => {
|
|
310
369
|
const popoverRef = _vitest.vi.fn();
|
|
311
|
-
const _render7 = (0,
|
|
370
|
+
const _render7 = (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
312
371
|
rootPageId: "page0",
|
|
313
372
|
popoverRef: popoverRef,
|
|
314
|
-
trigger: _button5 || (_button5 =
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
373
|
+
trigger: _button5 || (_button5 = (0, _jsxRuntime.jsx)("button", {
|
|
374
|
+
children: "Toggle"
|
|
375
|
+
})),
|
|
376
|
+
children: _Drilldown$Page8 || (_Drilldown$Page8 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
377
|
+
id: "page0",
|
|
378
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
379
|
+
id: "option01",
|
|
380
|
+
children: "Option"
|
|
381
|
+
})
|
|
382
|
+
}))
|
|
383
|
+
})),
|
|
320
384
|
container = _render7.container;
|
|
321
|
-
const trigger =
|
|
385
|
+
const trigger = _react.screen.getByText('Toggle');
|
|
322
386
|
const positionId = trigger.getAttribute('data-position-target');
|
|
323
387
|
const popoverRoot = container.querySelector(`span[data-position="${positionId}"]`);
|
|
324
388
|
expect(popoverRoot).toBeInTheDocument();
|
|
@@ -329,18 +393,23 @@ describe('<Drilldown />', () => {
|
|
|
329
393
|
});
|
|
330
394
|
it('should give back the Popover component when drilldown has trigger and is open', async () => {
|
|
331
395
|
const popoverRef = _vitest.vi.fn();
|
|
332
|
-
const _render8 = (0,
|
|
396
|
+
const _render8 = (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
333
397
|
rootPageId: "page0",
|
|
334
398
|
popoverRef: popoverRef,
|
|
335
|
-
trigger: _button6 || (_button6 =
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
399
|
+
trigger: _button6 || (_button6 = (0, _jsxRuntime.jsx)("button", {
|
|
400
|
+
children: "Toggle"
|
|
401
|
+
})),
|
|
402
|
+
defaultShow: true,
|
|
403
|
+
children: _Drilldown$Page9 || (_Drilldown$Page9 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
404
|
+
id: "page0",
|
|
405
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
406
|
+
id: "option01",
|
|
407
|
+
children: "Option"
|
|
408
|
+
})
|
|
409
|
+
}))
|
|
410
|
+
})),
|
|
342
411
|
container = _render8.container;
|
|
343
|
-
const trigger =
|
|
412
|
+
const trigger = _react.screen.getByText('Toggle');
|
|
344
413
|
const positionId = trigger.getAttribute('data-position-target');
|
|
345
414
|
const popoverRoot = container.querySelector(`span[data-position="${positionId}"]`);
|
|
346
415
|
expect(popoverRoot).toBeInTheDocument();
|
|
@@ -353,20 +422,22 @@ describe('<Drilldown />', () => {
|
|
|
353
422
|
describe('onSelect prop', () => {
|
|
354
423
|
it('should fire when option is selected', async () => {
|
|
355
424
|
const onSelect = _vitest.vi.fn();
|
|
356
|
-
(0,
|
|
425
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
357
426
|
rootPageId: "page0",
|
|
358
|
-
onSelect: onSelect
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
427
|
+
onSelect: onSelect,
|
|
428
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
429
|
+
id: "page0",
|
|
430
|
+
children: data.map(option => (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
431
|
+
id: option.id,
|
|
432
|
+
value: option.id,
|
|
433
|
+
"data-testid": option.id,
|
|
434
|
+
children: option.label
|
|
435
|
+
}, option.id))
|
|
436
|
+
})
|
|
437
|
+
}));
|
|
438
|
+
const option_1 = _react.screen.getByTestId('opt_1');
|
|
368
439
|
await _userEvent.default.click(option_1);
|
|
369
|
-
await (0,
|
|
440
|
+
await (0, _react.waitFor)(() => {
|
|
370
441
|
expect(onSelect).toHaveBeenCalled();
|
|
371
442
|
const args = onSelect.mock.calls[0][1];
|
|
372
443
|
const event = onSelect.mock.calls[0][0];
|
|
@@ -382,86 +453,108 @@ describe('<Drilldown />', () => {
|
|
|
382
453
|
});
|
|
383
454
|
it('should not fire when drilldown is disabled', async () => {
|
|
384
455
|
const onSelect = _vitest.vi.fn();
|
|
385
|
-
(0,
|
|
456
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
386
457
|
rootPageId: "page0",
|
|
387
458
|
onSelect: onSelect,
|
|
388
|
-
disabled: true
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
459
|
+
disabled: true,
|
|
460
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
461
|
+
id: "page0",
|
|
462
|
+
children: data.map(option => (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
463
|
+
id: option.id,
|
|
464
|
+
"data-testid": option.id,
|
|
465
|
+
children: option.label
|
|
466
|
+
}, option.id))
|
|
467
|
+
})
|
|
468
|
+
}));
|
|
469
|
+
const option_1 = _react.screen.getByTestId('opt_1');
|
|
397
470
|
await _userEvent.default.click(option_1);
|
|
398
|
-
await (0,
|
|
471
|
+
await (0, _react.waitFor)(() => {
|
|
399
472
|
expect(onSelect).not.toHaveBeenCalled();
|
|
400
473
|
});
|
|
401
474
|
});
|
|
402
475
|
});
|
|
403
476
|
describe('with a trigger', () => {
|
|
404
477
|
it('should not show content by default', async () => {
|
|
405
|
-
(0,
|
|
478
|
+
(0, _react.render)(_Drilldown10 || (_Drilldown10 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
406
479
|
rootPageId: "page0",
|
|
407
|
-
trigger:
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
480
|
+
trigger: (0, _jsxRuntime.jsx)("button", {
|
|
481
|
+
children: "click me"
|
|
482
|
+
}),
|
|
483
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
484
|
+
id: "page0",
|
|
485
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
486
|
+
id: "option0",
|
|
487
|
+
children: "Option 0"
|
|
488
|
+
})
|
|
489
|
+
})
|
|
490
|
+
})));
|
|
491
|
+
const option_0 = _react.screen.queryByText('Option 0');
|
|
414
492
|
expect(option_0).not.toBeInTheDocument();
|
|
415
493
|
});
|
|
416
494
|
it('should render into a mountNode', async () => {
|
|
417
495
|
const container = document.createElement('div');
|
|
418
496
|
container.setAttribute('data-testid', 'container');
|
|
419
497
|
document.body.appendChild(container);
|
|
420
|
-
(0,
|
|
498
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
421
499
|
rootPageId: "page0",
|
|
422
500
|
mountNode: container,
|
|
423
|
-
trigger: _button7 || (_button7 =
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
501
|
+
trigger: _button7 || (_button7 = (0, _jsxRuntime.jsx)("button", {
|
|
502
|
+
children: "Options"
|
|
503
|
+
})),
|
|
504
|
+
children: _Drilldown$Page10 || (_Drilldown$Page10 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
505
|
+
id: "page0",
|
|
506
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
507
|
+
id: "option0",
|
|
508
|
+
children: "Option 0"
|
|
509
|
+
})
|
|
510
|
+
}))
|
|
511
|
+
}));
|
|
512
|
+
const optionsContainer = _react.screen.getByTestId('container');
|
|
513
|
+
const trigger = _react.screen.getByRole('button');
|
|
431
514
|
expect(optionsContainer).not.toHaveTextContent('Option 0');
|
|
432
515
|
await _userEvent.default.click(trigger);
|
|
433
|
-
await (0,
|
|
434
|
-
const updatedOptionsContainer =
|
|
516
|
+
await (0, _react.waitFor)(() => {
|
|
517
|
+
const updatedOptionsContainer = _react.screen.getByTestId('container');
|
|
435
518
|
expect(updatedOptionsContainer).toHaveTextContent('Option 0');
|
|
436
519
|
});
|
|
437
520
|
});
|
|
438
521
|
it('should have an aria-haspopup attribute', async () => {
|
|
439
|
-
(0,
|
|
522
|
+
(0, _react.render)(_Drilldown11 || (_Drilldown11 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
440
523
|
rootPageId: "page0",
|
|
441
|
-
trigger:
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
524
|
+
trigger: (0, _jsxRuntime.jsx)("button", {
|
|
525
|
+
children: "Options"
|
|
526
|
+
}),
|
|
527
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
528
|
+
id: "page0",
|
|
529
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
530
|
+
id: "option0",
|
|
531
|
+
children: "Option 0"
|
|
532
|
+
})
|
|
533
|
+
})
|
|
534
|
+
})));
|
|
535
|
+
const trigger = _react.screen.getByRole('button');
|
|
448
536
|
expect(trigger).toHaveAttribute('aria-haspopup');
|
|
449
537
|
});
|
|
450
538
|
it('should call onToggle when Drilldown is opened', async () => {
|
|
451
539
|
const onToggle = _vitest.vi.fn();
|
|
452
|
-
(0,
|
|
540
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
453
541
|
rootPageId: "page0",
|
|
454
|
-
trigger: _button8 || (_button8 =
|
|
542
|
+
trigger: _button8 || (_button8 = (0, _jsxRuntime.jsx)("button", {
|
|
543
|
+
children: "Options"
|
|
544
|
+
})),
|
|
455
545
|
onToggle: onToggle,
|
|
456
|
-
"data-testid": "drilldown"
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
546
|
+
"data-testid": "drilldown",
|
|
547
|
+
children: _Drilldown$Page11 || (_Drilldown$Page11 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
548
|
+
id: "page0",
|
|
549
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
550
|
+
id: "option0",
|
|
551
|
+
children: "Option 0"
|
|
552
|
+
})
|
|
553
|
+
}))
|
|
554
|
+
}));
|
|
555
|
+
const trigger = _react.screen.getByRole('button');
|
|
463
556
|
await _userEvent.default.click(trigger);
|
|
464
|
-
await (0,
|
|
557
|
+
await (0, _react.waitFor)(() => {
|
|
465
558
|
expect(onToggle).toHaveBeenCalled();
|
|
466
559
|
const args = onToggle.mock.calls[0][1];
|
|
467
560
|
expect(args).toHaveProperty('shown', true);
|
|
@@ -474,19 +567,24 @@ describe('<Drilldown />', () => {
|
|
|
474
567
|
});
|
|
475
568
|
it('should call onToggle when Drilldown is closed', async () => {
|
|
476
569
|
const onToggle = _vitest.vi.fn();
|
|
477
|
-
(0,
|
|
570
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
478
571
|
rootPageId: "page0",
|
|
479
|
-
trigger: _button9 || (_button9 =
|
|
572
|
+
trigger: _button9 || (_button9 = (0, _jsxRuntime.jsx)("button", {
|
|
573
|
+
children: "Options"
|
|
574
|
+
})),
|
|
480
575
|
onToggle: onToggle,
|
|
481
|
-
defaultShow: true
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
576
|
+
defaultShow: true,
|
|
577
|
+
children: _Drilldown$Page12 || (_Drilldown$Page12 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
578
|
+
id: "page0",
|
|
579
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
580
|
+
id: "option0",
|
|
581
|
+
children: "Option 0"
|
|
582
|
+
})
|
|
583
|
+
}))
|
|
584
|
+
}));
|
|
585
|
+
const trigger = _react.screen.getByRole('button');
|
|
488
586
|
await _userEvent.default.click(trigger);
|
|
489
|
-
await (0,
|
|
587
|
+
await (0, _react.waitFor)(() => {
|
|
490
588
|
expect(onToggle).toHaveBeenCalled();
|
|
491
589
|
const args = onToggle.mock.calls[0][1];
|
|
492
590
|
expect(args).toHaveProperty('shown', false);
|
|
@@ -500,65 +598,85 @@ describe('<Drilldown />', () => {
|
|
|
500
598
|
describe('placement prop', () => {
|
|
501
599
|
it('should be passed to Popover', async () => {
|
|
502
600
|
let popoverRef = null;
|
|
503
|
-
(0,
|
|
601
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
504
602
|
rootPageId: "page0",
|
|
505
|
-
trigger: _button10 || (_button10 =
|
|
603
|
+
trigger: _button10 || (_button10 = (0, _jsxRuntime.jsx)("button", {
|
|
604
|
+
children: "Toggle"
|
|
605
|
+
})),
|
|
506
606
|
defaultShow: true,
|
|
507
607
|
popoverRef: e => {
|
|
508
608
|
popoverRef = e;
|
|
509
609
|
},
|
|
510
|
-
placement: 'top start'
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
610
|
+
placement: 'top start',
|
|
611
|
+
children: _Drilldown$Page13 || (_Drilldown$Page13 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
612
|
+
id: "page0",
|
|
613
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
614
|
+
id: "option01",
|
|
615
|
+
children: "Option"
|
|
616
|
+
})
|
|
617
|
+
}))
|
|
618
|
+
}));
|
|
516
619
|
const popoverProps = popoverRef.props;
|
|
517
620
|
expect(popoverProps.placement).toBe('top start');
|
|
518
621
|
});
|
|
519
622
|
});
|
|
520
623
|
describe('defaultShow prop', () => {
|
|
521
624
|
it('should display Popover on render', async () => {
|
|
522
|
-
(0,
|
|
625
|
+
(0, _react.render)(_Drilldown12 || (_Drilldown12 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
523
626
|
rootPageId: "page0",
|
|
524
|
-
trigger:
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
627
|
+
trigger: (0, _jsxRuntime.jsx)("button", {
|
|
628
|
+
children: "Toggle"
|
|
629
|
+
}),
|
|
630
|
+
defaultShow: true,
|
|
631
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
632
|
+
id: "page0",
|
|
633
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
634
|
+
id: "option01",
|
|
635
|
+
children: "Option"
|
|
636
|
+
})
|
|
637
|
+
})
|
|
638
|
+
})));
|
|
639
|
+
const popoverContent = _react.screen.getByText('Option');
|
|
532
640
|
expect(popoverContent).toBeVisible();
|
|
533
641
|
});
|
|
534
642
|
});
|
|
535
643
|
describe('show prop', () => {
|
|
536
644
|
it('should display popover', async () => {
|
|
537
645
|
const onToggle = _vitest.vi.fn();
|
|
538
|
-
(0,
|
|
646
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
539
647
|
rootPageId: "page0",
|
|
540
|
-
trigger: _button11 || (_button11 =
|
|
648
|
+
trigger: _button11 || (_button11 = (0, _jsxRuntime.jsx)("button", {
|
|
649
|
+
children: "Toggle"
|
|
650
|
+
})),
|
|
541
651
|
show: true,
|
|
542
|
-
onToggle: onToggle
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
652
|
+
onToggle: onToggle,
|
|
653
|
+
children: _Drilldown$Page14 || (_Drilldown$Page14 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
654
|
+
id: "page0",
|
|
655
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
656
|
+
id: "option01",
|
|
657
|
+
children: "Option"
|
|
658
|
+
})
|
|
659
|
+
}))
|
|
660
|
+
}));
|
|
661
|
+
const popoverContent = _react.screen.getByText('Option');
|
|
549
662
|
expect(popoverContent).toBeVisible();
|
|
550
663
|
});
|
|
551
664
|
it('should give error if onToggle is not provided (controllable)', async () => {
|
|
552
|
-
(0,
|
|
665
|
+
(0, _react.render)(_Drilldown13 || (_Drilldown13 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
553
666
|
rootPageId: "page0",
|
|
554
|
-
trigger:
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
667
|
+
trigger: (0, _jsxRuntime.jsx)("button", {
|
|
668
|
+
children: "Toggle"
|
|
669
|
+
}),
|
|
670
|
+
show: true,
|
|
671
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
672
|
+
id: "page0",
|
|
673
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
674
|
+
id: "option01",
|
|
675
|
+
children: "Option"
|
|
676
|
+
})
|
|
677
|
+
})
|
|
678
|
+
})));
|
|
679
|
+
const popoverContent = _react.screen.getByText('Option');
|
|
562
680
|
expect(popoverContent).toBeVisible();
|
|
563
681
|
expect(popoverContent).toBeVisible();
|
|
564
682
|
expect(consoleErrorMock).toHaveBeenCalled();
|
|
@@ -568,18 +686,23 @@ describe('<Drilldown />', () => {
|
|
|
568
686
|
it('should be passed to Popover', async () => {
|
|
569
687
|
let popoverRef = null;
|
|
570
688
|
const onFocus = _vitest.vi.fn();
|
|
571
|
-
(0,
|
|
689
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
572
690
|
rootPageId: "page0",
|
|
573
|
-
trigger: _button12 || (_button12 =
|
|
691
|
+
trigger: _button12 || (_button12 = (0, _jsxRuntime.jsx)("button", {
|
|
692
|
+
children: "Toggle"
|
|
693
|
+
})),
|
|
574
694
|
popoverRef: e => {
|
|
575
695
|
popoverRef = e;
|
|
576
696
|
},
|
|
577
|
-
onFocus: onFocus
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
697
|
+
onFocus: onFocus,
|
|
698
|
+
children: _Drilldown$Page15 || (_Drilldown$Page15 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
699
|
+
id: "page0",
|
|
700
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
701
|
+
id: "option01",
|
|
702
|
+
children: "Option"
|
|
703
|
+
})
|
|
704
|
+
}))
|
|
705
|
+
}));
|
|
583
706
|
const popoverProps = popoverRef.props;
|
|
584
707
|
expect(popoverProps.onFocus).toEqual(onFocus);
|
|
585
708
|
});
|
|
@@ -588,18 +711,23 @@ describe('<Drilldown />', () => {
|
|
|
588
711
|
it('should be passed to Popover', async () => {
|
|
589
712
|
let popoverRef = null;
|
|
590
713
|
const onMouseOver = _vitest.vi.fn();
|
|
591
|
-
(0,
|
|
714
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
592
715
|
rootPageId: "page0",
|
|
593
|
-
trigger: _button13 || (_button13 =
|
|
716
|
+
trigger: _button13 || (_button13 = (0, _jsxRuntime.jsx)("button", {
|
|
717
|
+
children: "Toggle"
|
|
718
|
+
})),
|
|
594
719
|
popoverRef: e => {
|
|
595
720
|
popoverRef = e;
|
|
596
721
|
},
|
|
597
|
-
onMouseOver: onMouseOver
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
722
|
+
onMouseOver: onMouseOver,
|
|
723
|
+
children: _Drilldown$Page16 || (_Drilldown$Page16 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
724
|
+
id: "page0",
|
|
725
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
726
|
+
id: "option01",
|
|
727
|
+
children: "Option"
|
|
728
|
+
})
|
|
729
|
+
}))
|
|
730
|
+
}));
|
|
603
731
|
const popoverProps = popoverRef.props;
|
|
604
732
|
expect(popoverProps.onMouseOver).toEqual(onMouseOver);
|
|
605
733
|
});
|
|
@@ -607,18 +735,23 @@ describe('<Drilldown />', () => {
|
|
|
607
735
|
describe('shouldContainFocus prop', () => {
|
|
608
736
|
it('should be passed to Popover', async () => {
|
|
609
737
|
let popoverRef = null;
|
|
610
|
-
(0,
|
|
738
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
611
739
|
rootPageId: "page0",
|
|
612
|
-
trigger: _button14 || (_button14 =
|
|
740
|
+
trigger: _button14 || (_button14 = (0, _jsxRuntime.jsx)("button", {
|
|
741
|
+
children: "Toggle"
|
|
742
|
+
})),
|
|
613
743
|
popoverRef: e => {
|
|
614
744
|
popoverRef = e;
|
|
615
745
|
},
|
|
616
|
-
shouldContainFocus: true
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
746
|
+
shouldContainFocus: true,
|
|
747
|
+
children: _Drilldown$Page17 || (_Drilldown$Page17 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
748
|
+
id: "page0",
|
|
749
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
750
|
+
id: "option01",
|
|
751
|
+
children: "Option"
|
|
752
|
+
})
|
|
753
|
+
}))
|
|
754
|
+
}));
|
|
622
755
|
const popoverProps = popoverRef.props;
|
|
623
756
|
expect(popoverProps.shouldContainFocus).toEqual(true);
|
|
624
757
|
});
|
|
@@ -626,18 +759,23 @@ describe('<Drilldown />', () => {
|
|
|
626
759
|
describe('shouldReturnFocus prop', () => {
|
|
627
760
|
it('should be passed to Popover', async () => {
|
|
628
761
|
let popoverRef = null;
|
|
629
|
-
(0,
|
|
762
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
630
763
|
rootPageId: "page0",
|
|
631
|
-
trigger: _button15 || (_button15 =
|
|
764
|
+
trigger: _button15 || (_button15 = (0, _jsxRuntime.jsx)("button", {
|
|
765
|
+
children: "Toggle"
|
|
766
|
+
})),
|
|
632
767
|
popoverRef: e => {
|
|
633
768
|
popoverRef = e;
|
|
634
769
|
},
|
|
635
|
-
shouldReturnFocus: false
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
770
|
+
shouldReturnFocus: false,
|
|
771
|
+
children: _Drilldown$Page18 || (_Drilldown$Page18 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
772
|
+
id: "page0",
|
|
773
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
774
|
+
id: "option01",
|
|
775
|
+
children: "Option"
|
|
776
|
+
})
|
|
777
|
+
}))
|
|
778
|
+
}));
|
|
641
779
|
const popoverProps = popoverRef.props;
|
|
642
780
|
expect(popoverProps.shouldReturnFocus).toEqual(false);
|
|
643
781
|
});
|
|
@@ -645,18 +783,23 @@ describe('<Drilldown />', () => {
|
|
|
645
783
|
describe('withArrow prop', () => {
|
|
646
784
|
it('should be passed to Popover', async () => {
|
|
647
785
|
let popoverRef = null;
|
|
648
|
-
(0,
|
|
786
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
649
787
|
rootPageId: "page0",
|
|
650
|
-
trigger: _button16 || (_button16 =
|
|
788
|
+
trigger: _button16 || (_button16 = (0, _jsxRuntime.jsx)("button", {
|
|
789
|
+
children: "Toggle"
|
|
790
|
+
})),
|
|
651
791
|
popoverRef: e => {
|
|
652
792
|
popoverRef = e;
|
|
653
793
|
},
|
|
654
|
-
withArrow: false
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
794
|
+
withArrow: false,
|
|
795
|
+
children: _Drilldown$Page19 || (_Drilldown$Page19 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
796
|
+
id: "page0",
|
|
797
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
798
|
+
id: "option01",
|
|
799
|
+
children: "Option"
|
|
800
|
+
})
|
|
801
|
+
}))
|
|
802
|
+
}));
|
|
660
803
|
const popoverProps = popoverRef.props;
|
|
661
804
|
expect(popoverProps.withArrow).toEqual(false);
|
|
662
805
|
});
|
|
@@ -664,18 +807,23 @@ describe('<Drilldown />', () => {
|
|
|
664
807
|
describe('offsetX prop', () => {
|
|
665
808
|
it('should be passed to Popover', async () => {
|
|
666
809
|
let popoverRef = null;
|
|
667
|
-
(0,
|
|
810
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
668
811
|
rootPageId: "page0",
|
|
669
|
-
trigger: _button17 || (_button17 =
|
|
812
|
+
trigger: _button17 || (_button17 = (0, _jsxRuntime.jsx)("button", {
|
|
813
|
+
children: "Toggle"
|
|
814
|
+
})),
|
|
670
815
|
popoverRef: e => {
|
|
671
816
|
popoverRef = e;
|
|
672
817
|
},
|
|
673
|
-
offsetX: '2rem'
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
818
|
+
offsetX: '2rem',
|
|
819
|
+
children: _Drilldown$Page20 || (_Drilldown$Page20 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
820
|
+
id: "page0",
|
|
821
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
822
|
+
id: "option01",
|
|
823
|
+
children: "Option"
|
|
824
|
+
})
|
|
825
|
+
}))
|
|
826
|
+
}));
|
|
679
827
|
const popoverProps = popoverRef.props;
|
|
680
828
|
expect(popoverProps.offsetX).toEqual('2rem');
|
|
681
829
|
});
|
|
@@ -683,18 +831,23 @@ describe('<Drilldown />', () => {
|
|
|
683
831
|
describe('offsetY prop', () => {
|
|
684
832
|
it('should be passed to Popover', async () => {
|
|
685
833
|
let popoverRef = null;
|
|
686
|
-
(0,
|
|
834
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
687
835
|
rootPageId: "page0",
|
|
688
|
-
trigger: _button18 || (_button18 =
|
|
836
|
+
trigger: _button18 || (_button18 = (0, _jsxRuntime.jsx)("button", {
|
|
837
|
+
children: "Toggle"
|
|
838
|
+
})),
|
|
689
839
|
popoverRef: e => {
|
|
690
840
|
popoverRef = e;
|
|
691
841
|
},
|
|
692
|
-
offsetY: '2rem'
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
842
|
+
offsetY: '2rem',
|
|
843
|
+
children: _Drilldown$Page21 || (_Drilldown$Page21 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
844
|
+
id: "page0",
|
|
845
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
846
|
+
id: "option01",
|
|
847
|
+
children: "Option"
|
|
848
|
+
})
|
|
849
|
+
}))
|
|
850
|
+
}));
|
|
698
851
|
const popoverProps = popoverRef.props;
|
|
699
852
|
expect(popoverProps.offsetY).toEqual('2rem');
|
|
700
853
|
});
|
|
@@ -702,80 +855,105 @@ describe('<Drilldown />', () => {
|
|
|
702
855
|
describe('positionContainerDisplay prop', () => {
|
|
703
856
|
it('should be passed to Popover', async () => {
|
|
704
857
|
let popoverRef = null;
|
|
705
|
-
(0,
|
|
858
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
706
859
|
rootPageId: "page0",
|
|
707
|
-
trigger: _button19 || (_button19 =
|
|
860
|
+
trigger: _button19 || (_button19 = (0, _jsxRuntime.jsx)("button", {
|
|
861
|
+
children: "Toggle"
|
|
862
|
+
})),
|
|
708
863
|
popoverRef: e => {
|
|
709
864
|
popoverRef = e;
|
|
710
865
|
},
|
|
711
|
-
positionContainerDisplay: "block"
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
866
|
+
positionContainerDisplay: "block",
|
|
867
|
+
children: _Drilldown$Page22 || (_Drilldown$Page22 = (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
868
|
+
id: "page0",
|
|
869
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
870
|
+
id: "option01",
|
|
871
|
+
children: "Option"
|
|
872
|
+
})
|
|
873
|
+
}))
|
|
874
|
+
}));
|
|
717
875
|
const popoverProps = popoverRef.props;
|
|
718
876
|
expect(popoverProps.positionContainerDisplay).toEqual('block');
|
|
719
877
|
});
|
|
720
878
|
});
|
|
721
879
|
describe('for a11y', () => {
|
|
722
880
|
it('should be accessible', async () => {
|
|
723
|
-
const _render9 = (0,
|
|
724
|
-
rootPageId: "page0"
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
881
|
+
const _render9 = (0, _react.render)(_Drilldown14 || (_Drilldown14 = (0, _jsxRuntime.jsxs)(_index.Drilldown, {
|
|
882
|
+
rootPageId: "page0",
|
|
883
|
+
children: [(0, _jsxRuntime.jsxs)(_index.Drilldown.Page, {
|
|
884
|
+
id: "page0",
|
|
885
|
+
renderTitle: "Page Title",
|
|
886
|
+
renderActionLabel: "Action Label",
|
|
887
|
+
children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
888
|
+
id: "item01",
|
|
889
|
+
children: "Item1"
|
|
890
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
891
|
+
id: "item02",
|
|
892
|
+
subPageId: "page1",
|
|
893
|
+
children: "Item2"
|
|
894
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
895
|
+
id: "item03",
|
|
896
|
+
description: "This is a description",
|
|
897
|
+
children: "Item3"
|
|
898
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
899
|
+
id: "item04",
|
|
900
|
+
renderLabelInfo: "After",
|
|
901
|
+
children: "Item4"
|
|
902
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
903
|
+
id: "item05",
|
|
904
|
+
disabled: true,
|
|
905
|
+
children: "Item5"
|
|
906
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
907
|
+
id: "item06",
|
|
908
|
+
href: "/",
|
|
909
|
+
children: "Item6"
|
|
910
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
911
|
+
id: "item07",
|
|
912
|
+
renderBeforeLabel: (0, _jsxRuntime.jsx)(_IconCheckSolid.IconCheckSolid, {}),
|
|
913
|
+
children: "Item7"
|
|
914
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
915
|
+
id: "item08",
|
|
916
|
+
renderAfterLabel: (0, _jsxRuntime.jsx)(_IconCheckSolid.IconCheckSolid, {}),
|
|
917
|
+
children: "Item8"
|
|
918
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Separator, {
|
|
919
|
+
id: "sep1"
|
|
920
|
+
}), (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
|
|
921
|
+
id: "group1",
|
|
922
|
+
renderGroupTitle: "Multi-select group",
|
|
923
|
+
selectableType: "multiple",
|
|
924
|
+
children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
925
|
+
id: "groupItem11",
|
|
926
|
+
children: "GroupItem"
|
|
927
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
928
|
+
id: "groupItem12",
|
|
929
|
+
children: "GroupItem"
|
|
930
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
931
|
+
id: "groupItem13",
|
|
932
|
+
children: "GroupItem"
|
|
933
|
+
})]
|
|
934
|
+
}), (0, _jsxRuntime.jsxs)(_index.Drilldown.Group, {
|
|
935
|
+
id: "group2",
|
|
936
|
+
renderGroupTitle: "Single-select group",
|
|
937
|
+
selectableType: "single",
|
|
938
|
+
children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
939
|
+
id: "groupItem21",
|
|
940
|
+
children: "GroupItem"
|
|
941
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
942
|
+
id: "groupItem22",
|
|
943
|
+
children: "GroupItem"
|
|
944
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
945
|
+
id: "groupItem23",
|
|
946
|
+
children: "GroupItem"
|
|
947
|
+
})]
|
|
948
|
+
})]
|
|
949
|
+
}), (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
950
|
+
id: "page1",
|
|
951
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
952
|
+
id: "item11",
|
|
953
|
+
children: "Item1"
|
|
954
|
+
})
|
|
955
|
+
})]
|
|
956
|
+
}))),
|
|
779
957
|
container = _render9.container;
|
|
780
958
|
|
|
781
959
|
// axe-check is more strict now, and expects "list" role to have "listitem" children, but we use "role='none'" children. After discussing it with the A11y team, we agreed to ignore this error because the screen readers can read the component perfectly.
|
|
@@ -787,14 +965,17 @@ describe('<Drilldown />', () => {
|
|
|
787
965
|
expect(axeCheck).toBe(true);
|
|
788
966
|
});
|
|
789
967
|
it('should meet a11y standarts when drilldown is open', async () => {
|
|
790
|
-
const _render10 = (0,
|
|
968
|
+
const _render10 = (0, _react.render)(_Drilldown15 || (_Drilldown15 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
|
|
791
969
|
defaultShow: true,
|
|
792
|
-
rootPageId: "page0"
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
970
|
+
rootPageId: "page0",
|
|
971
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
|
|
972
|
+
id: "page0",
|
|
973
|
+
children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
|
|
974
|
+
id: "option0",
|
|
975
|
+
children: "Option 0"
|
|
976
|
+
})
|
|
977
|
+
})
|
|
978
|
+
}))),
|
|
798
979
|
container = _render10.container;
|
|
799
980
|
const axeCheck = await (0, _runAxeCheck.runAxeCheck)(container);
|
|
800
981
|
expect(axeCheck).toBe(true);
|
|
@@ -805,7 +986,7 @@ describe('<Drilldown />', () => {
|
|
|
805
986
|
it.each(generatedComponents)('should be accessible with example: $description', async ({
|
|
806
987
|
content
|
|
807
988
|
}) => {
|
|
808
|
-
const _render11 = (0,
|
|
989
|
+
const _render11 = (0, _react.render)(content),
|
|
809
990
|
container = _render11.container;
|
|
810
991
|
const axeCheck = await (0, _runAxeCheck.runAxeCheck)(container, {
|
|
811
992
|
// axe-check is more strict now, and expects "list" role to have "listitem" children, but we use "role='none'" children. After discussing it with the A11y team, we agreed to ignore this error because the screen readers can read the component perfectly.
|