orc-shared 5.10.1-dev.8 → 5.10.1-dev.9

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 (133) hide show
  1. package/dist/components/Authenticate.js +41 -17
  2. package/dist/components/ErrorPlaceholder.js +8 -24
  3. package/dist/components/{Icon.js → Form/Inputs/MultiSelector.js} +33 -20
  4. package/dist/components/Form/Inputs/index.js +1 -1
  5. package/dist/components/LoadingIcon.js +6 -16
  6. package/dist/components/MaterialUI/Inputs/Select.js +10 -0
  7. package/dist/components/MaterialUI/Inputs/SelectProps.js +3 -1
  8. package/dist/components/MaterialUI/Navigation/DropDownMenu.js +2 -4
  9. package/dist/components/Provision.js +30 -13
  10. package/dist/components/Routing/SegmentPage.js +115 -56
  11. package/dist/components/Scope/ScopeNode.js +68 -45
  12. package/dist/components/Sidepanel.js +57 -23
  13. package/dist/components/Spritesheet.js +33 -17
  14. package/dist/components/Text.js +1 -60
  15. package/dist/components/Treeview/Branch.js +82 -20
  16. package/dist/components/Treeview/Label.js +108 -31
  17. package/dist/components/Treeview/Leaf.js +56 -12
  18. package/dist/components/Treeview/Node.js +22 -9
  19. package/dist/components/Treeview/index.js +7 -1
  20. package/dist/components/Treeview/settings.js +7 -5
  21. package/dist/utils/index.js +0 -4
  22. package/dist/utils/testUtils.js +1 -12
  23. package/package.json +1 -1
  24. package/src/components/ApplicationModuleLoader.test.js +14 -27
  25. package/src/components/Authenticate.js +29 -21
  26. package/src/components/Authenticate.test.js +18 -27
  27. package/src/components/ErrorPlaceholder.js +4 -21
  28. package/src/components/ErrorPlaceholder.test.js +7 -14
  29. package/src/components/Form/InputField.test.js +2 -1
  30. package/src/components/Form/Inputs/MultiSelector.js +23 -0
  31. package/src/components/Form/Inputs/MultiSelector.test.js +112 -0
  32. package/src/components/Form/Inputs/index.js +1 -1
  33. package/src/components/Loader.test.js +21 -33
  34. package/src/components/LoadingIcon.js +2 -15
  35. package/src/components/LoadingIcon.test.js +2 -20
  36. package/src/components/MaterialUI/DataDisplay/Table.test.js +1 -1
  37. package/src/components/MaterialUI/Inputs/Select.js +7 -0
  38. package/src/components/MaterialUI/Inputs/Select.test.js +45 -0
  39. package/src/components/MaterialUI/Inputs/SelectProps.js +2 -0
  40. package/src/components/MaterialUI/Inputs/SelectProps.test.js +2 -0
  41. package/src/components/MaterialUI/Navigation/DropDownMenu.js +2 -2
  42. package/src/components/MaterialUI/Navigation/DropDownMenu.test.js +5 -6
  43. package/src/components/Navigation/Navigation.test.js +0 -5
  44. package/src/components/Navigation/useNavigationState.test.js +79 -222
  45. package/src/components/Provision.js +36 -42
  46. package/src/components/Provision.test.js +10 -26
  47. package/src/components/Routing/SegmentPage.js +68 -52
  48. package/src/components/Routing/SegmentPage.test.js +4 -12
  49. package/src/components/Scope/ScopeNode.js +61 -54
  50. package/src/components/Scope/ScopeNode.test.js +61 -154
  51. package/src/components/ScopeExtendedConfigurationLoader.test.js +1 -4
  52. package/src/components/Sidepanel.js +38 -32
  53. package/src/components/Sidepanel.test.js +49 -27
  54. package/src/components/Spritesheet.js +23 -21
  55. package/src/components/Spritesheet.test.js +10 -10
  56. package/src/components/Text.js +0 -49
  57. package/src/components/Treeview/Branch.js +63 -45
  58. package/src/components/Treeview/Branch.test.js +21 -24
  59. package/src/components/Treeview/Label.js +66 -52
  60. package/src/components/Treeview/Label.test.js +42 -60
  61. package/src/components/Treeview/Leaf.js +41 -22
  62. package/src/components/Treeview/Leaf.test.js +15 -10
  63. package/src/components/Treeview/Node.js +16 -9
  64. package/src/components/Treeview/Node.test.js +269 -200
  65. package/src/components/Treeview/Treeview.test.js +248 -248
  66. package/src/components/Treeview/index.js +6 -0
  67. package/src/components/Treeview/settings.js +7 -6
  68. package/src/utils/index.js +0 -4
  69. package/src/utils/testUtils.js +0 -10
  70. package/src/utils/testUtils.test.js +0 -68
  71. package/dist/components/Button.js +0 -70
  72. package/dist/components/Checkbox.js +0 -103
  73. package/dist/components/IconButton.js +0 -80
  74. package/dist/components/Input.js +0 -101
  75. package/dist/components/Modal/Background.js +0 -55
  76. package/dist/components/Modal/Dialog.js +0 -75
  77. package/dist/components/Modal/Wrapper.js +0 -69
  78. package/dist/components/Modal/index.js +0 -86
  79. package/dist/components/MultiSelector.js +0 -187
  80. package/dist/components/Navigation/Bar.js +0 -293
  81. package/dist/components/Navigation/Tab.js +0 -182
  82. package/dist/components/Placeholder.js +0 -114
  83. package/dist/components/Scope/Selector.js +0 -123
  84. package/dist/components/Selector.js +0 -185
  85. package/dist/components/Switch.js +0 -128
  86. package/dist/components/Toolbar.js +0 -227
  87. package/dist/components/Tooltip.js +0 -66
  88. package/dist/getTheme.js +0 -153
  89. package/dist/getThemeOverrides.js +0 -93
  90. package/dist/hocs/withAuthentication.js +0 -72
  91. package/dist/utils/styledPropFuncs.js +0 -88
  92. package/src/components/Button.js +0 -90
  93. package/src/components/Button.test.js +0 -49
  94. package/src/components/Checkbox.js +0 -63
  95. package/src/components/Checkbox.test.js +0 -122
  96. package/src/components/Icon.js +0 -18
  97. package/src/components/IconButton.js +0 -30
  98. package/src/components/IconButton.test.js +0 -61
  99. package/src/components/Input.js +0 -35
  100. package/src/components/Input.test.js +0 -34
  101. package/src/components/Modal/Background.js +0 -10
  102. package/src/components/Modal/Dialog.js +0 -27
  103. package/src/components/Modal/Dialog.test.js +0 -20
  104. package/src/components/Modal/Modal.test.js +0 -52
  105. package/src/components/Modal/Wrapper.js +0 -32
  106. package/src/components/Modal/Wrapper.test.js +0 -55
  107. package/src/components/Modal/index.js +0 -22
  108. package/src/components/MultiSelector.js +0 -104
  109. package/src/components/MultiSelector.test.js +0 -348
  110. package/src/components/Navigation/Bar.js +0 -212
  111. package/src/components/Navigation/Bar.test.js +0 -552
  112. package/src/components/Navigation/Tab.js +0 -156
  113. package/src/components/Navigation/Tab.test.js +0 -404
  114. package/src/components/Placeholder.js +0 -61
  115. package/src/components/Placeholder.test.js +0 -106
  116. package/src/components/Scope/Selector.js +0 -70
  117. package/src/components/Scope/Selector.test.js +0 -138
  118. package/src/components/Selector.js +0 -191
  119. package/src/components/Selector.test.js +0 -157
  120. package/src/components/Switch.js +0 -112
  121. package/src/components/Switch.test.js +0 -130
  122. package/src/components/Text.test.js +0 -132
  123. package/src/components/Toolbar.js +0 -178
  124. package/src/components/Toolbar.test.js +0 -478
  125. package/src/components/Tooltip.js +0 -51
  126. package/src/components/Tooltip.test.js +0 -21
  127. package/src/getTheme.js +0 -98
  128. package/src/getTheme.test.js +0 -92
  129. package/src/getThemeOverrides.js +0 -27
  130. package/src/hocs/withAuthentication.js +0 -18
  131. package/src/hocs/withAuthentication.test.js +0 -120
  132. package/src/utils/styledPropFuncs.js +0 -20
  133. package/src/utils/styledPropFuncs.test.js +0 -166
@@ -1,11 +1,14 @@
1
1
  import React from "react";
2
2
  import sinon from "sinon";
3
3
  import { Ignore } from "unexpected-reaction";
4
- import { getStyledClassSelector, PropStruct } from "../../utils/testUtils";
4
+ import { PropStruct, TestWrapper } from "../../utils/testUtils";
5
5
  import Node, { RootNode, LeafNode, TreeContext } from "./Node";
6
6
  import { Branch } from "./Branch";
7
7
  import { Leaf, Root } from "./Leaf";
8
8
  import { BeforeIndicator, Indicator, NonIndicator, Label } from "./Label";
9
+ import { createMuiTheme } from "../../utils/testUtils";
10
+
11
+ const theme = createMuiTheme();
9
12
 
10
13
  describe("RootNode", () => {
11
14
  let contextValue, Wrap;
@@ -19,30 +22,38 @@ describe("RootNode", () => {
19
22
 
20
23
  it("renders a root node", () =>
21
24
  expect(
22
- <Wrap>
23
- <RootNode thing="stuff" />
24
- </Wrap>,
25
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
26
+ <Wrap>
27
+ <RootNode thing="stuff" />
28
+ </Wrap>
29
+ </TestWrapper>,
25
30
  "when mounted",
26
31
  "to satisfy",
27
- <Root>
28
- <Label>
29
- <PropStruct thing="stuff" foo={true} bar={false} />
30
- </Label>
31
- </Root>,
32
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
33
+ <Root>
34
+ <Label>
35
+ <PropStruct thing="stuff" foo={true} bar={false} />
36
+ </Label>
37
+ </Root>
38
+ </TestWrapper>,
32
39
  ));
33
40
 
34
41
  it("renders a selected root node", () =>
35
42
  expect(
36
- <Wrap>
37
- <RootNode thing="stuff" isSelectedNode={true} />
38
- </Wrap>,
43
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
44
+ <Wrap>
45
+ <RootNode thing="stuff" isSelectedNode={true} />
46
+ </Wrap>
47
+ </TestWrapper>,
39
48
  "when mounted",
40
49
  "to satisfy",
41
- <Root>
42
- <Label isSelectedNode={true}>
43
- <PropStruct thing="stuff" foo={true} bar={false} />
44
- </Label>
45
- </Root>,
50
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
51
+ <Root>
52
+ <Label isSelectedNode={true}>
53
+ <PropStruct thing="stuff" foo={true} bar={false} />
54
+ </Label>
55
+ </Root>
56
+ </TestWrapper>,
46
57
  ));
47
58
  });
48
59
 
@@ -62,84 +73,104 @@ describe("LeafNode", () => {
62
73
 
63
74
  it("renders a closed node with children", () =>
64
75
  expect(
65
- <Wrap>
66
- <LeafNode thing="stuff" id="testNode" children={["foo"]} />
67
- </Wrap>,
76
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
77
+ <Wrap>
78
+ <LeafNode thing="stuff" id="testNode" children={["foo"]} />
79
+ </Wrap>
80
+ </TestWrapper>,
68
81
  "when mounted",
69
82
  "to satisfy",
70
- <Leaf>
71
- <BeforeIndicator />
72
- <Indicator open={undefined} onClick={expect.it("to be a function")} />
73
- <Label>
74
- <PropStruct thing="stuff" id="testNode" foo={true} bar={false} />
75
- </Label>
76
- </Leaf>,
83
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
84
+ <Leaf>
85
+ <BeforeIndicator />
86
+ <Indicator open={undefined} onClick={expect.it("to be a function")} />
87
+ <Label>
88
+ <PropStruct thing="stuff" id="testNode" foo={true} bar={false} />
89
+ </Label>
90
+ </Leaf>
91
+ </TestWrapper>,
77
92
  ));
78
93
 
79
94
  it("renders a closed node with children", () =>
80
95
  expect(
81
- <Wrap>
82
- <LeafNode open thing="stuff" id="testNode" children={["foo"]} />
83
- </Wrap>,
96
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
97
+ <Wrap>
98
+ <LeafNode open thing="stuff" id="testNode" children={["foo"]} />
99
+ </Wrap>
100
+ </TestWrapper>,
84
101
  "when mounted",
85
102
  "to satisfy",
86
- <Leaf>
87
- <BeforeIndicator />
88
- <Indicator open={true} onClick={expect.it("to be a function")} />
89
- <Label>
90
- <PropStruct open={true} thing="stuff" id="testNode" foo={true} bar={false} />
91
- </Label>
92
- </Leaf>,
103
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
104
+ <Leaf>
105
+ <BeforeIndicator />
106
+ <Indicator open={true} onClick={expect.it("to be a function")} />
107
+ <Label>
108
+ <PropStruct open={true} thing="stuff" id="testNode" foo={true} bar={false} />
109
+ </Label>
110
+ </Leaf>
111
+ </TestWrapper>,
93
112
  ));
94
113
 
95
114
  it("renders a node with no children", () =>
96
115
  expect(
97
- <Wrap>
98
- <LeafNode thing="stuff" id="testNode" />
99
- </Wrap>,
116
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
117
+ <Wrap>
118
+ <LeafNode thing="stuff" id="testNode" />
119
+ </Wrap>
120
+ </TestWrapper>,
100
121
  "when mounted",
101
122
  "to satisfy",
102
- <Leaf>
103
- <NonIndicator />
104
- <Label>
105
- <PropStruct thing="stuff" id="testNode" foo={true} bar={false} />
106
- </Label>
107
- </Leaf>,
123
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
124
+ <Leaf>
125
+ <NonIndicator />
126
+ <Label>
127
+ <PropStruct thing="stuff" id="testNode" foo={true} bar={false} />
128
+ </Label>
129
+ </Leaf>
130
+ </TestWrapper>,
108
131
  ));
109
132
 
110
133
  it("renders a selected node", () =>
111
134
  expect(
112
- <Wrap>
113
- <LeafNode thing="stuff" id="testNode" isSelectedNode={true} />
114
- </Wrap>,
135
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
136
+ <Wrap>
137
+ <LeafNode thing="stuff" id="testNode" isSelectedNode={true} />
138
+ </Wrap>
139
+ </TestWrapper>,
115
140
  "when mounted",
116
141
  "to satisfy",
117
- <Leaf>
118
- <NonIndicator />
119
- <Label isSelectedNode={true}>
120
- <PropStruct thing="stuff" id="testNode" foo={true} bar={false} />
121
- </Label>
122
- </Leaf>,
142
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
143
+ <Leaf>
144
+ <NonIndicator />
145
+ <Label isSelectedNode={true}>
146
+ <PropStruct thing="stuff" id="testNode" foo={true} bar={false} />
147
+ </Label>
148
+ </Leaf>
149
+ </TestWrapper>,
123
150
  ));
124
151
 
125
152
  it("updates nodeState on click on the indicator, opening if closed", () =>
126
153
  expect(
127
- <Wrap>
128
- <LeafNode thing="stuff" id="testNode" children={["foo"]} />
129
- </Wrap>,
154
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
155
+ <Wrap>
156
+ <LeafNode thing="stuff" id="testNode" children={["foo"]} />
157
+ </Wrap>
158
+ </TestWrapper>,
130
159
  "when mounted",
131
160
  "with event",
132
- { type: "click", target: getStyledClassSelector(Indicator) },
161
+ { type: "click", target: '[data-qa="indicator"]' },
133
162
  ).then(() => expect(updater, "to have calls satisfying", [{ args: [{ otherNode: false, testNode: true }] }])));
134
163
 
135
164
  it("updates nodeState on click on the indicator, closing if open", () =>
136
165
  expect(
137
- <Wrap>
138
- <LeafNode open thing="stuff" id="testNode" children={["foo"]} />
139
- </Wrap>,
166
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
167
+ <Wrap>
168
+ <LeafNode open thing="stuff" id="testNode" children={["foo"]} />
169
+ </Wrap>
170
+ </TestWrapper>,
140
171
  "when mounted",
141
172
  "with event",
142
- { type: "click", target: getStyledClassSelector(Indicator) },
173
+ { type: "click", target: '[data-qa="indicator"]' },
143
174
  ).then(() => expect(updater, "to have calls satisfying", [{ args: [{ otherNode: false, testNode: false }] }])));
144
175
  });
145
176
 
@@ -168,9 +199,11 @@ describe("Node", () => {
168
199
 
169
200
  it("renders a nonexistent node as nothing", () =>
170
201
  expect(
171
- <Wrap>
172
- <Node id="nonExistent" />
173
- </Wrap>,
202
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
203
+ <Wrap>
204
+ <Node id="nonExistent" />
205
+ </Wrap>
206
+ </TestWrapper>,
174
207
  "when mounted",
175
208
  "to satisfy",
176
209
  expect.it("not to contain", <Leaf />).and("not to contain", <Branch />),
@@ -178,20 +211,24 @@ describe("Node", () => {
178
211
 
179
212
  it("renders a childless node as only the leaf", () =>
180
213
  expect(
181
- <Wrap>
182
- <Node id="exists" />
183
- </Wrap>,
214
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
215
+ <Wrap>
216
+ <Node id="exists" />
217
+ </Wrap>
218
+ </TestWrapper>,
184
219
  "when mounted",
185
220
  "to satisfy",
186
221
  expect
187
222
  .it(
188
223
  "to satisfy",
189
- <div>
190
- <Leaf>
191
- <NonIndicator />
192
- <Ignore />
193
- </Leaf>
194
- </div>,
224
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
225
+ <div>
226
+ <Leaf>
227
+ <NonIndicator />
228
+ <Ignore />
229
+ </Leaf>
230
+ </div>
231
+ </TestWrapper>,
195
232
  )
196
233
  .and(
197
234
  "queried for first",
@@ -204,19 +241,23 @@ describe("Node", () => {
204
241
 
205
242
  it("renders a childless root node as only the leaf", () =>
206
243
  expect(
207
- <Wrap>
208
- <Node root id="exists" />
209
- </Wrap>,
244
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
245
+ <Wrap>
246
+ <Node root id="exists" />
247
+ </Wrap>
248
+ </TestWrapper>,
210
249
  "when mounted",
211
250
  "to satisfy",
212
251
  expect
213
252
  .it(
214
253
  "to satisfy",
215
- <div>
216
- <Root>
217
- <Ignore />
218
- </Root>
219
- </div>,
254
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
255
+ <div>
256
+ <Root>
257
+ <Ignore />
258
+ </Root>
259
+ </div>
260
+ </TestWrapper>,
220
261
  )
221
262
  .and(
222
263
  "queried for first",
@@ -229,29 +270,33 @@ describe("Node", () => {
229
270
 
230
271
  it("renders a node with children as leaf and branch", () =>
231
272
  expect(
232
- <Wrap>
233
- <Node id="hasKids" />
234
- </Wrap>,
273
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
274
+ <Wrap>
275
+ <Node id="hasKids" />
276
+ </Wrap>
277
+ </TestWrapper>,
235
278
  "when mounted",
236
279
  "to satisfy",
237
280
  expect
238
281
  .it(
239
282
  "to satisfy",
240
- <div>
241
- <Leaf>
242
- <BeforeIndicator />
243
- <Indicator open />
244
- <Label>
245
- <Ignore />
246
- </Label>
247
- </Leaf>
248
- <Branch>
283
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
284
+ <div>
249
285
  <Leaf>
250
- <Ignore />
251
- <Ignore />
286
+ <BeforeIndicator />
287
+ <Indicator open />
288
+ <Label>
289
+ <Ignore />
290
+ </Label>
252
291
  </Leaf>
253
- </Branch>
254
- </div>,
292
+ <Branch>
293
+ <Leaf>
294
+ <Ignore />
295
+ <Ignore />
296
+ </Leaf>
297
+ </Branch>
298
+ </div>
299
+ </TestWrapper>,
255
300
  )
256
301
  .and(
257
302
  "queried for first",
@@ -261,7 +306,7 @@ describe("Node", () => {
261
306
  )
262
307
  .and(
263
308
  "queried for first",
264
- getStyledClassSelector(Branch),
309
+ "[data-qa='branch']",
265
310
  "to contain",
266
311
  <PropStruct id="exists" other="data" open={false} foo={true} bar={false} />,
267
312
  ),
@@ -270,51 +315,59 @@ describe("Node", () => {
270
315
  it("renders a selected node", () => {
271
316
  contextValue.selectedNodeId = "hasKids";
272
317
  expect(
273
- <Wrap>
274
- <Node id="hasKids" />
275
- </Wrap>,
318
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
319
+ <Wrap>
320
+ <Node id="hasKids" />
321
+ </Wrap>
322
+ </TestWrapper>,
276
323
  "when mounted",
277
324
  "to satisfy",
278
325
  expect.it(
279
326
  "to satisfy",
280
- <div>
281
- <Leaf>
282
- <BeforeIndicator />
283
- <Indicator open />
284
- <Label isSelectedNode={true}>
285
- <Ignore />
286
- </Label>
287
- </Leaf>
288
- <Branch>
327
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
328
+ <div>
289
329
  <Leaf>
290
- <Ignore />
291
- <Ignore />
330
+ <BeforeIndicator />
331
+ <Indicator open />
332
+ <Label isSelectedNode={true}>
333
+ <Ignore />
334
+ </Label>
292
335
  </Leaf>
293
- </Branch>
294
- </div>,
336
+ <Branch>
337
+ <Leaf>
338
+ <Ignore />
339
+ <Ignore />
340
+ </Leaf>
341
+ </Branch>
342
+ </div>
343
+ </TestWrapper>,
295
344
  ),
296
345
  );
297
346
  });
298
347
 
299
348
  it("renders a closed node with children as only the leaf", () =>
300
349
  expect(
301
- <Wrap>
302
- <Node id="isClosed" />
303
- </Wrap>,
350
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
351
+ <Wrap>
352
+ <Node id="isClosed" />
353
+ </Wrap>
354
+ </TestWrapper>,
304
355
  "when mounted",
305
356
  "to satisfy",
306
357
  expect
307
358
  .it(
308
359
  "to satisfy",
309
- <div>
310
- <Leaf>
311
- <BeforeIndicator />
312
- <Indicator />
313
- <Label>
314
- <Ignore />
315
- </Label>
316
- </Leaf>
317
- </div>,
360
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
361
+ <div>
362
+ <Leaf>
363
+ <BeforeIndicator />
364
+ <Indicator />
365
+ <Label>
366
+ <Ignore />
367
+ </Label>
368
+ </Leaf>
369
+ </div>
370
+ </TestWrapper>,
318
371
  )
319
372
  .and(
320
373
  "queried for first",
@@ -328,47 +381,19 @@ describe("Node", () => {
328
381
  it("renders a selected root node", () => {
329
382
  contextValue.selectedNodeId = "isClosed";
330
383
  expect(
331
- <Wrap>
332
- <Node root id="isClosed" />
333
- </Wrap>,
384
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
385
+ <Wrap>
386
+ <Node root id="isClosed" />
387
+ </Wrap>
388
+ </TestWrapper>,
334
389
  "when mounted",
335
390
  "to satisfy",
336
391
  expect.it(
337
392
  "to satisfy",
338
- <div>
339
- <Root>
340
- <Label isSelectedNode={true}>
341
- <Ignore />
342
- </Label>
343
- </Root>
344
- <Branch>
345
- <Leaf>
346
- <Ignore />
347
- <Ignore />
348
- <Ignore />
349
- </Leaf>
350
- <Branch>
351
- <Ignore />
352
- </Branch>
353
- </Branch>
354
- </div>,
355
- ),
356
- );
357
- });
358
-
359
- it("renders a root node with children as leaf and branch", () =>
360
- expect(
361
- <Wrap>
362
- <Node root id="isClosed" />
363
- </Wrap>,
364
- "when mounted",
365
- "to satisfy",
366
- expect
367
- .it(
368
- "to satisfy",
393
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
369
394
  <div>
370
395
  <Root>
371
- <Label>
396
+ <Label isSelectedNode={true}>
372
397
  <Ignore />
373
398
  </Label>
374
399
  </Root>
@@ -382,7 +407,43 @@ describe("Node", () => {
382
407
  <Ignore />
383
408
  </Branch>
384
409
  </Branch>
385
- </div>,
410
+ </div>
411
+ </TestWrapper>,
412
+ ),
413
+ );
414
+ });
415
+
416
+ it("renders a root node with children as leaf and branch", () =>
417
+ expect(
418
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
419
+ <Wrap>
420
+ <Node root id="isClosed" />
421
+ </Wrap>
422
+ </TestWrapper>,
423
+ "when mounted",
424
+ "to satisfy",
425
+ expect
426
+ .it(
427
+ "to satisfy",
428
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
429
+ <div>
430
+ <Root>
431
+ <Label>
432
+ <Ignore />
433
+ </Label>
434
+ </Root>
435
+ <Branch>
436
+ <Leaf>
437
+ <Ignore />
438
+ <Ignore />
439
+ <Ignore />
440
+ </Leaf>
441
+ <Branch>
442
+ <Ignore />
443
+ </Branch>
444
+ </Branch>
445
+ </div>
446
+ </TestWrapper>,
386
447
  )
387
448
  .and(
388
449
  "queried for first",
@@ -400,29 +461,33 @@ describe("Node", () => {
400
461
 
401
462
  it("renders a node with children as leaf and branch", () =>
402
463
  expect(
403
- <Wrap>
404
- <Node id="hasKids" />
405
- </Wrap>,
464
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
465
+ <Wrap>
466
+ <Node id="hasKids" />
467
+ </Wrap>
468
+ </TestWrapper>,
406
469
  "when mounted",
407
470
  "to satisfy",
408
471
  expect
409
472
  .it(
410
473
  "to satisfy",
411
- <div>
412
- <Leaf>
413
- <BeforeIndicator />
414
- <Indicator open />
415
- <Label>
416
- <Ignore />
417
- </Label>
418
- </Leaf>
419
- <Branch>
474
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
475
+ <div>
420
476
  <Leaf>
421
- <Ignore />
422
- <Ignore />
477
+ <BeforeIndicator />
478
+ <Indicator open />
479
+ <Label>
480
+ <Ignore />
481
+ </Label>
423
482
  </Leaf>
424
- </Branch>
425
- </div>,
483
+ <Branch>
484
+ <Leaf>
485
+ <Ignore />
486
+ <Ignore />
487
+ </Leaf>
488
+ </Branch>
489
+ </div>
490
+ </TestWrapper>,
426
491
  )
427
492
  .and(
428
493
  "queried for first",
@@ -432,7 +497,7 @@ describe("Node", () => {
432
497
  )
433
498
  .and(
434
499
  "queried for first",
435
- getStyledClassSelector(Branch),
500
+ "[data-qa='branch']",
436
501
  "to contain",
437
502
  <PropStruct id="exists" other="data" open={true} foo={true} bar={false} />,
438
503
  ),
@@ -440,33 +505,37 @@ describe("Node", () => {
440
505
 
441
506
  it("renders a closed node with children as if open", () =>
442
507
  expect(
443
- <Wrap>
444
- <Node id="isClosed" />
445
- </Wrap>,
508
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
509
+ <Wrap>
510
+ <Node id="isClosed" />
511
+ </Wrap>
512
+ </TestWrapper>,
446
513
  "when mounted",
447
514
  "to satisfy",
448
515
  expect
449
516
  .it(
450
517
  "to satisfy",
451
- <div>
452
- <Leaf>
453
- <BeforeIndicator />
454
- <Indicator open />
455
- <Label>
456
- <Ignore />
457
- </Label>
458
- </Leaf>
459
- <Branch>
518
+ <TestWrapper stylesProvider muiThemeProvider={{ theme }}>
519
+ <div>
460
520
  <Leaf>
461
- <Ignore />
462
- <Ignore />
463
- <Ignore />
521
+ <BeforeIndicator />
522
+ <Indicator open />
523
+ <Label>
524
+ <Ignore />
525
+ </Label>
464
526
  </Leaf>
465
527
  <Branch>
466
- <Ignore />
528
+ <Leaf>
529
+ <Ignore />
530
+ <Ignore />
531
+ <Ignore />
532
+ </Leaf>
533
+ <Branch>
534
+ <Ignore />
535
+ </Branch>
467
536
  </Branch>
468
- </Branch>
469
- </div>,
537
+ </div>
538
+ </TestWrapper>,
470
539
  )
471
540
  .and(
472
541
  "queried for first",
@@ -476,7 +545,7 @@ describe("Node", () => {
476
545
  )
477
546
  .and(
478
547
  "queried for first",
479
- getStyledClassSelector(Branch),
548
+ "[data-qa='branch']",
480
549
  "to contain",
481
550
  <PropStruct id="hasKids" other="info" open={true} foo={true} bar={false} />,
482
551
  ),