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