@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
@@ -32,7 +32,6 @@ var _dec, _class, _DrilldownOption;
32
32
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
33
  * SOFTWARE.
34
34
  */
35
- /** @jsx jsx */
36
35
  /**
37
36
  ---
38
37
  parent: Drilldown
@@ -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, _Drilldown2, _Drilldown$Option, _Drilldown$Option2, _Drilldown3, _Drilldown$Option3, _Drilldown$Option4, _Drilldown$Option5, _Drilldown4, _Drilldown5, _Drilldown$Option6, _Drilldown$Option7, _Drilldown6, _Drilldown7, _Drilldown8, _Drilldown9, _Drilldown10;
11
11
  /*
12
12
  * The MIT License (MIT)
@@ -44,53 +44,65 @@ describe('<Drilldown.Page />', () => {
44
44
  consoleErrorMock.mockRestore();
45
45
  });
46
46
  it("shouldn't render non-DrilldownPage children", async () => {
47
- (0, _react2.render)(_Drilldown || (_Drilldown = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
48
- rootPageId: "page0"
49
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
50
- id: "page0"
51
- }, /*#__PURE__*/_react.default.createElement("div", {
52
- id: "testDiv"
53
- }, "Div")))));
54
- const nonPageChild = _react2.screen.queryByText('DIV');
47
+ (0, _react.render)(_Drilldown || (_Drilldown = (0, _jsxRuntime.jsx)(_index.Drilldown, {
48
+ rootPageId: "page0",
49
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
50
+ id: "page0",
51
+ children: (0, _jsxRuntime.jsx)("div", {
52
+ id: "testDiv",
53
+ children: "Div"
54
+ })
55
+ })
56
+ })));
57
+ const nonPageChild = _react.screen.queryByText('DIV');
55
58
  expect(nonPageChild).not.toBeInTheDocument();
56
59
  });
57
60
  describe('header title', () => {
58
61
  it('should be displayed in the header', async () => {
59
- const _render = (0, _react2.render)(_Drilldown2 || (_Drilldown2 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
60
- rootPageId: "page0"
61
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
62
- id: "page0",
63
- renderTitle: "HeaderTitleString"
64
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
65
- id: "option1"
66
- }, "Option"))))),
62
+ const _render = (0, _react.render)(_Drilldown2 || (_Drilldown2 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
63
+ rootPageId: "page0",
64
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
65
+ id: "page0",
66
+ renderTitle: "HeaderTitleString",
67
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
68
+ id: "option1",
69
+ children: "Option"
70
+ })
71
+ })
72
+ }))),
67
73
  container = _render.container;
68
74
  const titleContainer = container.querySelector('[id^="DrilldownHeader-Title-Label_"]');
69
- const title = _react2.screen.queryByText('HeaderTitleString');
75
+ const title = _react.screen.queryByText('HeaderTitleString');
70
76
  expect(titleContainer).toBeInTheDocument();
71
77
  expect(title).toBeInTheDocument();
72
78
  });
73
79
  it('should be displayed when function is passed', async () => {
74
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
75
- rootPageId: "page0"
76
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
77
- id: "page0",
78
- renderTitle: () => 'HeaderTitleFunction'
79
- }, _Drilldown$Option || (_Drilldown$Option = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
80
- id: "option1"
81
- }, "Option")))));
82
- const title = _react2.screen.queryByText('HeaderTitleFunction');
80
+ (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
81
+ rootPageId: "page0",
82
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
83
+ id: "page0",
84
+ renderTitle: () => 'HeaderTitleFunction',
85
+ children: _Drilldown$Option || (_Drilldown$Option = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
86
+ id: "option1",
87
+ children: "Option"
88
+ }))
89
+ })
90
+ }));
91
+ const title = _react.screen.queryByText('HeaderTitleFunction');
83
92
  expect(title).toBeInTheDocument();
84
93
  });
85
94
  it("shouldn't be displayed when function has no return value", async () => {
86
- const _render2 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
87
- rootPageId: "page0"
88
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
89
- id: "page0",
90
- renderTitle: () => null
91
- }, _Drilldown$Option2 || (_Drilldown$Option2 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
92
- id: "option1"
93
- }, "Option"))))),
95
+ const _render2 = (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
96
+ rootPageId: "page0",
97
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
98
+ id: "page0",
99
+ renderTitle: () => null,
100
+ children: _Drilldown$Option2 || (_Drilldown$Option2 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
101
+ id: "option1",
102
+ children: "Option"
103
+ }))
104
+ })
105
+ })),
94
106
  container = _render2.container;
95
107
  const title = container.querySelector('[id^="DrilldownHeader-Title-Label_"]');
96
108
  const listItem = container.querySelector('li');
@@ -100,38 +112,47 @@ describe('<Drilldown.Page />', () => {
100
112
  });
101
113
  describe('header action label', () => {
102
114
  it('should be displayed in the header', async () => {
103
- (0, _react2.render)(_Drilldown3 || (_Drilldown3 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
104
- rootPageId: "page0"
105
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
106
- id: "page0",
107
- renderActionLabel: "HeaderActionLabelString"
108
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
109
- id: "option1"
110
- }, "Option")))));
111
- const actionLabel = _react2.screen.queryByText('HeaderActionLabelString');
115
+ (0, _react.render)(_Drilldown3 || (_Drilldown3 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
116
+ rootPageId: "page0",
117
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
118
+ id: "page0",
119
+ renderActionLabel: "HeaderActionLabelString",
120
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
121
+ id: "option1",
122
+ children: "Option"
123
+ })
124
+ })
125
+ })));
126
+ const actionLabel = _react.screen.queryByText('HeaderActionLabelString');
112
127
  expect(actionLabel).toBeInTheDocument();
113
128
  });
114
129
  it('should be displayed when function is passed', async () => {
115
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
116
- rootPageId: "page0"
117
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
118
- id: "page0",
119
- renderActionLabel: () => 'HeaderActionLabelFunction'
120
- }, _Drilldown$Option3 || (_Drilldown$Option3 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
121
- id: "option1"
122
- }, "Option")))));
123
- const actionLabel = _react2.screen.queryByText('HeaderActionLabelFunction');
130
+ (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
131
+ rootPageId: "page0",
132
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
133
+ id: "page0",
134
+ renderActionLabel: () => 'HeaderActionLabelFunction',
135
+ children: _Drilldown$Option3 || (_Drilldown$Option3 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
136
+ id: "option1",
137
+ children: "Option"
138
+ }))
139
+ })
140
+ }));
141
+ const actionLabel = _react.screen.queryByText('HeaderActionLabelFunction');
124
142
  expect(actionLabel).toBeInTheDocument();
125
143
  });
126
144
  it("shouldn't be displayed when function has no return value", async () => {
127
- const _render3 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
128
- rootPageId: "page0"
129
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
130
- id: "page0",
131
- renderActionLabel: () => null
132
- }, _Drilldown$Option4 || (_Drilldown$Option4 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
133
- id: "option1"
134
- }, "Option"))))),
145
+ const _render3 = (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
146
+ rootPageId: "page0",
147
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
148
+ id: "page0",
149
+ renderActionLabel: () => null,
150
+ children: _Drilldown$Option4 || (_Drilldown$Option4 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
151
+ id: "option1",
152
+ children: "Option"
153
+ }))
154
+ })
155
+ })),
135
156
  container = _render3.container;
136
157
  const listItem = container.querySelector('li');
137
158
  const title = container.querySelector('[id^="DrilldownHeader-Title-Label_"]');
@@ -140,116 +161,141 @@ describe('<Drilldown.Page />', () => {
140
161
  });
141
162
  it('should fire header action callback', async () => {
142
163
  const actionCallback = _vitest.vi.fn();
143
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
144
- rootPageId: "page0"
145
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
146
- id: "page0",
147
- renderActionLabel: "ActionWithCallback",
148
- onHeaderActionClicked: actionCallback
149
- }, _Drilldown$Option5 || (_Drilldown$Option5 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
150
- id: "option1"
151
- }, "Option")))));
152
- const actionLabel = _react2.screen.getByText('ActionWithCallback');
164
+ (0, _react.render)((0, _jsxRuntime.jsx)(_index.Drilldown, {
165
+ rootPageId: "page0",
166
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
167
+ id: "page0",
168
+ renderActionLabel: "ActionWithCallback",
169
+ onHeaderActionClicked: actionCallback,
170
+ children: _Drilldown$Option5 || (_Drilldown$Option5 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
171
+ id: "option1",
172
+ children: "Option"
173
+ }))
174
+ })
175
+ }));
176
+ const actionLabel = _react.screen.getByText('ActionWithCallback');
153
177
  await _userEvent.default.click(actionLabel);
154
- await (0, _react2.waitFor)(() => {
178
+ await (0, _react.waitFor)(() => {
155
179
  expect(actionCallback).toHaveBeenCalled();
156
180
  });
157
181
  });
158
182
  });
159
183
  describe('header back navigation', () => {
160
184
  it('should not be displayed on root page', async () => {
161
- (0, _react2.render)(_Drilldown4 || (_Drilldown4 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
162
- rootPageId: "page0"
163
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
164
- id: "page0",
165
- renderBackButtonLabel: "HeaderBackString"
166
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
167
- id: "option1"
168
- }, "Option")))));
169
- const label = _react2.screen.queryByText('HeaderBackString');
185
+ (0, _react.render)(_Drilldown4 || (_Drilldown4 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
186
+ rootPageId: "page0",
187
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
188
+ id: "page0",
189
+ renderBackButtonLabel: "HeaderBackString",
190
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
191
+ id: "option1",
192
+ children: "Option"
193
+ })
194
+ })
195
+ })));
196
+ const label = _react.screen.queryByText('HeaderBackString');
170
197
  expect(label).not.toBeInTheDocument();
171
198
  });
172
199
  it('should be displayed on subpages', async () => {
173
- (0, _react2.render)(_Drilldown5 || (_Drilldown5 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
174
- rootPageId: "page0"
175
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
176
- id: "page0"
177
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
178
- id: "option1",
179
- subPageId: "page2"
180
- }, "Option")), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
181
- id: "page2",
182
- renderBackButtonLabel: "HeaderBackString"
183
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
184
- id: "option2"
185
- }, "Option")))));
186
- const option = _react2.screen.getByText('Option');
200
+ (0, _react.render)(_Drilldown5 || (_Drilldown5 = (0, _jsxRuntime.jsxs)(_index.Drilldown, {
201
+ rootPageId: "page0",
202
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
203
+ id: "page0",
204
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
205
+ id: "option1",
206
+ subPageId: "page2",
207
+ children: "Option"
208
+ })
209
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
210
+ id: "page2",
211
+ renderBackButtonLabel: "HeaderBackString",
212
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
213
+ id: "option2",
214
+ children: "Option"
215
+ })
216
+ })]
217
+ })));
218
+ const option = _react.screen.getByText('Option');
187
219
  await _userEvent.default.click(option);
188
- await (0, _react2.waitFor)(() => {
189
- const label = _react2.screen.queryByText('HeaderBackString');
220
+ await (0, _react.waitFor)(() => {
221
+ const label = _react.screen.queryByText('HeaderBackString');
190
222
  expect(label).toBeInTheDocument();
191
223
  });
192
224
  });
193
225
  it('should be displayed when function is passed, and can use former page title', async () => {
194
226
  const pageTitle = 'Page Title';
195
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Drilldown, {
196
- rootPageId: "page0"
197
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
198
- id: "page0",
199
- renderTitle: pageTitle
200
- }, _Drilldown$Option6 || (_Drilldown$Option6 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
201
- id: "option1",
202
- subPageId: "page2"
203
- }, "Option"))), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
204
- id: "page2",
205
- renderBackButtonLabel: prevPageTitle => `Back to ${prevPageTitle}`
206
- }, _Drilldown$Option7 || (_Drilldown$Option7 = /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
207
- id: "option2"
208
- }, "Option")))));
209
- const option = _react2.screen.getByText('Option');
227
+ (0, _react.render)((0, _jsxRuntime.jsxs)(_index.Drilldown, {
228
+ rootPageId: "page0",
229
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
230
+ id: "page0",
231
+ renderTitle: pageTitle,
232
+ children: _Drilldown$Option6 || (_Drilldown$Option6 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
233
+ id: "option1",
234
+ subPageId: "page2",
235
+ children: "Option"
236
+ }))
237
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
238
+ id: "page2",
239
+ renderBackButtonLabel: prevPageTitle => `Back to ${prevPageTitle}`,
240
+ children: _Drilldown$Option7 || (_Drilldown$Option7 = (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
241
+ id: "option2",
242
+ children: "Option"
243
+ }))
244
+ })]
245
+ }));
246
+ const option = _react.screen.getByText('Option');
210
247
  await _userEvent.default.click(option);
211
- await (0, _react2.waitFor)(() => {
212
- const label = _react2.screen.queryByText(`Back to ${pageTitle}`);
248
+ await (0, _react.waitFor)(() => {
249
+ const label = _react.screen.queryByText(`Back to ${pageTitle}`);
213
250
  expect(label).toBeInTheDocument();
214
251
  });
215
252
  });
216
253
  });
217
254
  describe('header separator', () => {
218
255
  it('should not be displayed, if no item is on the header', async () => {
219
- const _render4 = (0, _react2.render)(_Drilldown6 || (_Drilldown6 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
220
- rootPageId: "page0"
221
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
222
- id: "page0"
223
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
224
- id: "option1"
225
- }, "Option"))))),
256
+ const _render4 = (0, _react.render)(_Drilldown6 || (_Drilldown6 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
257
+ rootPageId: "page0",
258
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
259
+ id: "page0",
260
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
261
+ id: "option1",
262
+ children: "Option"
263
+ })
264
+ })
265
+ }))),
226
266
  container = _render4.container;
227
267
  const separator = container.querySelector('[id^="DrilldownHeader-Separator_"]');
228
268
  expect(separator).not.toBeInTheDocument();
229
269
  });
230
270
  it('should be displayed, if there are items in the header', async () => {
231
- const _render5 = (0, _react2.render)(_Drilldown7 || (_Drilldown7 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
232
- rootPageId: "page0"
233
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
234
- id: "page0",
235
- renderTitle: "Title"
236
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
237
- id: "option1"
238
- }, "Option"))))),
271
+ const _render5 = (0, _react.render)(_Drilldown7 || (_Drilldown7 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
272
+ rootPageId: "page0",
273
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
274
+ id: "page0",
275
+ renderTitle: "Title",
276
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
277
+ id: "option1",
278
+ children: "Option"
279
+ })
280
+ })
281
+ }))),
239
282
  container = _render5.container;
240
283
  const separator = container.querySelector('[id^="DrilldownHeader-Separator_"]');
241
284
  expect(separator).toBeInTheDocument();
242
285
  });
243
286
  it('should not be displayed, if withoutHeaderSeparator is set', async () => {
244
- const _render6 = (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
- renderTitle: "Title",
249
- withoutHeaderSeparator: true
250
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
251
- id: "option1"
252
- }, "Option"))))),
287
+ const _render6 = (0, _react.render)(_Drilldown8 || (_Drilldown8 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
288
+ rootPageId: "page0",
289
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
290
+ id: "page0",
291
+ renderTitle: "Title",
292
+ withoutHeaderSeparator: true,
293
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
294
+ id: "option1",
295
+ children: "Option"
296
+ })
297
+ })
298
+ }))),
253
299
  container = _render6.container;
254
300
  const separator = container.querySelector('[id^="DrilldownHeader-Separator_"]');
255
301
  expect(separator).not.toBeInTheDocument();
@@ -257,40 +303,48 @@ describe('<Drilldown.Page />', () => {
257
303
  });
258
304
  describe('disabled prop', () => {
259
305
  it('should make all options disabled', async () => {
260
- (0, _react2.render)(_Drilldown9 || (_Drilldown9 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
261
- rootPageId: "page0"
262
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
263
- id: "page0",
264
- renderActionLabel: "Action Label",
265
- disabled: true
266
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
267
- id: "option1"
268
- }, "Option")))));
269
- const allOptions = _react2.screen.getAllByRole('menuitem');
306
+ (0, _react.render)(_Drilldown9 || (_Drilldown9 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
307
+ rootPageId: "page0",
308
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
309
+ id: "page0",
310
+ renderActionLabel: "Action Label",
311
+ disabled: true,
312
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
313
+ id: "option1",
314
+ children: "Option"
315
+ })
316
+ })
317
+ })));
318
+ const allOptions = _react.screen.getAllByRole('menuitem');
270
319
  allOptions.forEach(option => {
271
320
  expect(option).toHaveAttribute('aria-disabled', 'true');
272
321
  });
273
322
  });
274
323
  it("shouldn't make header Back options disabled", async () => {
275
- (0, _react2.render)(_Drilldown10 || (_Drilldown10 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
276
- rootPageId: "page0"
277
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
278
- id: "page0"
279
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
280
- id: "option1",
281
- subPageId: "page2"
282
- }, "Option1")), /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
283
- id: "page2",
284
- disabled: true,
285
- renderBackButtonLabel: "HeaderBackString"
286
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Option, {
287
- id: "option2"
288
- }, "Option2")))));
289
- const subPageOption = _react2.screen.getByText('Option1');
324
+ (0, _react.render)(_Drilldown10 || (_Drilldown10 = (0, _jsxRuntime.jsxs)(_index.Drilldown, {
325
+ rootPageId: "page0",
326
+ children: [(0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
327
+ id: "page0",
328
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
329
+ id: "option1",
330
+ subPageId: "page2",
331
+ children: "Option1"
332
+ })
333
+ }), (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
334
+ id: "page2",
335
+ disabled: true,
336
+ renderBackButtonLabel: "HeaderBackString",
337
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Option, {
338
+ id: "option2",
339
+ children: "Option2"
340
+ })
341
+ })]
342
+ })));
343
+ const subPageOption = _react.screen.getByText('Option1');
290
344
  await _userEvent.default.click(subPageOption);
291
- await (0, _react2.waitFor)(() => {
292
- const option2 = _react2.screen.getByLabelText('Option2');
293
- const backOption = _react2.screen.getByLabelText('HeaderBackString');
345
+ await (0, _react.waitFor)(() => {
346
+ const option2 = _react.screen.getByLabelText('Option2');
347
+ const backOption = _react.screen.getByLabelText('HeaderBackString');
294
348
  expect(option2).toHaveAttribute('role', 'menuitem');
295
349
  expect(option2).toHaveAttribute('aria-disabled', 'true');
296
350
  expect(backOption).toHaveAttribute('role', 'menuitem');
@@ -30,8 +30,6 @@ var _props = require("./props");
30
30
  * SOFTWARE.
31
31
  */
32
32
 
33
- /** @jsx jsx */
34
-
35
33
  /**
36
34
  ---
37
35
  parent: Drilldown
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _react = _interopRequireDefault(require("react"));
5
- var _react2 = require("@testing-library/react");
3
+ var _react = require("@testing-library/react");
6
4
  require("@testing-library/jest-dom");
7
5
  var _index = require("../../index");
6
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
8
7
  var _Drilldown, _Drilldown2;
9
8
  /*
10
9
  * The MIT License (MIT)
@@ -31,28 +30,33 @@ var _Drilldown, _Drilldown2;
31
30
  */
32
31
  describe('<Drilldown.Separator />', () => {
33
32
  it('should render', async () => {
34
- (0, _react2.render)(_Drilldown || (_Drilldown = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
35
- rootPageId: "page0"
36
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
37
- id: "page0"
38
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Separator, {
39
- id: "sep1",
40
- "data-testid": "separator1"
41
- })))));
42
- const separator = _react2.screen.getByTestId('separator1');
33
+ (0, _react.render)(_Drilldown || (_Drilldown = (0, _jsxRuntime.jsx)(_index.Drilldown, {
34
+ rootPageId: "page0",
35
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
36
+ id: "page0",
37
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Separator, {
38
+ id: "sep1",
39
+ "data-testid": "separator1"
40
+ })
41
+ })
42
+ })));
43
+ const separator = _react.screen.getByTestId('separator1');
43
44
  expect(separator).toBeVisible();
44
45
  expect(separator.getAttribute('class')).toContain('-separator');
45
46
  });
46
47
  it('should not render children', async () => {
47
- (0, _react2.render)(_Drilldown2 || (_Drilldown2 = /*#__PURE__*/_react.default.createElement(_index.Drilldown, {
48
- rootPageId: "page0"
49
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Page, {
50
- id: "page0"
51
- }, /*#__PURE__*/_react.default.createElement(_index.Drilldown.Separator, {
52
- id: "sep1",
53
- "data-testid": "separator1"
54
- }, "Children")))));
55
- const separatorChild = _react2.screen.queryByText('Children');
48
+ (0, _react.render)(_Drilldown2 || (_Drilldown2 = (0, _jsxRuntime.jsx)(_index.Drilldown, {
49
+ rootPageId: "page0",
50
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Page, {
51
+ id: "page0",
52
+ children: (0, _jsxRuntime.jsx)(_index.Drilldown.Separator, {
53
+ id: "sep1",
54
+ "data-testid": "separator1",
55
+ children: "Children"
56
+ })
57
+ })
58
+ })));
59
+ const separatorChild = _react.screen.queryByText('Children');
56
60
  expect(separatorChild).not.toBeInTheDocument();
57
61
  });
58
62
  });
@@ -32,7 +32,6 @@ var _dec, _class, _DrilldownSeparator;
32
32
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
33
  * SOFTWARE.
34
34
  */
35
- /** @jsx jsx */
36
35
  /**
37
36
  ---
38
37
  parent: Drilldown