orc-shared 5.10.1-dev.7 → 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.
- package/dist/components/Authenticate.js +41 -17
- package/dist/components/ErrorPlaceholder.js +8 -24
- package/dist/components/{Icon.js → Form/Inputs/MultiSelector.js} +33 -20
- package/dist/components/Form/Inputs/index.js +1 -1
- package/dist/components/LoadingIcon.js +6 -16
- package/dist/components/MaterialUI/Inputs/Select.js +10 -0
- package/dist/components/MaterialUI/Inputs/SelectProps.js +3 -1
- package/dist/components/MaterialUI/Navigation/DropDownMenu.js +2 -4
- package/dist/components/Provision.js +30 -13
- package/dist/components/Routing/SegmentPage.js +115 -56
- package/dist/components/Scope/ScopeNode.js +68 -45
- package/dist/components/Sidepanel.js +57 -23
- package/dist/components/Spritesheet.js +33 -17
- package/dist/components/Text.js +1 -60
- package/dist/components/Treeview/Branch.js +82 -20
- package/dist/components/Treeview/Label.js +108 -31
- package/dist/components/Treeview/Leaf.js +56 -12
- package/dist/components/Treeview/Node.js +22 -9
- package/dist/components/Treeview/index.js +7 -1
- package/dist/components/Treeview/settings.js +7 -5
- package/dist/utils/index.js +0 -4
- package/dist/utils/testUtils.js +1 -12
- package/package.json +1 -1
- package/src/components/ApplicationModuleLoader.test.js +14 -27
- package/src/components/Authenticate.js +29 -21
- package/src/components/Authenticate.test.js +18 -27
- package/src/components/ErrorPlaceholder.js +4 -21
- package/src/components/ErrorPlaceholder.test.js +7 -14
- package/src/components/Form/InputField.test.js +2 -1
- package/src/components/Form/Inputs/MultiSelector.js +23 -0
- package/src/components/Form/Inputs/MultiSelector.test.js +112 -0
- package/src/components/Form/Inputs/index.js +1 -1
- package/src/components/Loader.test.js +21 -33
- package/src/components/LoadingIcon.js +2 -15
- package/src/components/LoadingIcon.test.js +2 -20
- package/src/components/MaterialUI/DataDisplay/Table.test.js +1 -1
- package/src/components/MaterialUI/Inputs/Select.js +7 -0
- package/src/components/MaterialUI/Inputs/Select.test.js +45 -0
- package/src/components/MaterialUI/Inputs/SelectProps.js +2 -0
- package/src/components/MaterialUI/Inputs/SelectProps.test.js +2 -0
- package/src/components/MaterialUI/Navigation/DropDownMenu.js +2 -2
- package/src/components/MaterialUI/Navigation/DropDownMenu.test.js +5 -6
- package/src/components/Navigation/Navigation.test.js +0 -5
- package/src/components/Navigation/useNavigationState.test.js +79 -222
- package/src/components/Provision.js +36 -42
- package/src/components/Provision.test.js +10 -26
- package/src/components/Routing/SegmentPage.js +68 -52
- package/src/components/Routing/SegmentPage.test.js +4 -12
- package/src/components/Scope/ScopeNode.js +61 -54
- package/src/components/Scope/ScopeNode.test.js +61 -154
- package/src/components/ScopeExtendedConfigurationLoader.test.js +1 -4
- package/src/components/Sidepanel.js +38 -32
- package/src/components/Sidepanel.test.js +49 -27
- package/src/components/Spritesheet.js +23 -21
- package/src/components/Spritesheet.test.js +10 -10
- package/src/components/Text.js +0 -49
- package/src/components/Treeview/Branch.js +63 -45
- package/src/components/Treeview/Branch.test.js +21 -24
- package/src/components/Treeview/Label.js +66 -52
- package/src/components/Treeview/Label.test.js +42 -60
- package/src/components/Treeview/Leaf.js +41 -22
- package/src/components/Treeview/Leaf.test.js +15 -10
- package/src/components/Treeview/Node.js +16 -9
- package/src/components/Treeview/Node.test.js +269 -200
- package/src/components/Treeview/Treeview.test.js +248 -248
- package/src/components/Treeview/index.js +6 -0
- package/src/components/Treeview/settings.js +7 -6
- package/src/utils/index.js +0 -4
- package/src/utils/testUtils.js +0 -10
- package/src/utils/testUtils.test.js +0 -68
- package/dist/components/Button.js +0 -70
- package/dist/components/Checkbox.js +0 -103
- package/dist/components/IconButton.js +0 -80
- package/dist/components/Input.js +0 -101
- package/dist/components/Modal/Background.js +0 -55
- package/dist/components/Modal/Dialog.js +0 -75
- package/dist/components/Modal/Wrapper.js +0 -69
- package/dist/components/Modal/index.js +0 -86
- package/dist/components/MultiSelector.js +0 -187
- package/dist/components/Navigation/Bar.js +0 -293
- package/dist/components/Navigation/Tab.js +0 -182
- package/dist/components/Placeholder.js +0 -114
- package/dist/components/Scope/Selector.js +0 -123
- package/dist/components/Selector.js +0 -185
- package/dist/components/Switch.js +0 -128
- package/dist/components/Toolbar.js +0 -227
- package/dist/components/Tooltip.js +0 -66
- package/dist/getTheme.js +0 -153
- package/dist/getThemeOverrides.js +0 -93
- package/dist/hocs/withAuthentication.js +0 -72
- package/dist/utils/styledPropFuncs.js +0 -88
- package/src/components/Button.js +0 -90
- package/src/components/Button.test.js +0 -49
- package/src/components/Checkbox.js +0 -63
- package/src/components/Checkbox.test.js +0 -122
- package/src/components/Icon.js +0 -18
- package/src/components/IconButton.js +0 -30
- package/src/components/IconButton.test.js +0 -61
- package/src/components/Input.js +0 -35
- package/src/components/Input.test.js +0 -34
- package/src/components/Modal/Background.js +0 -10
- package/src/components/Modal/Dialog.js +0 -27
- package/src/components/Modal/Dialog.test.js +0 -20
- package/src/components/Modal/Modal.test.js +0 -52
- package/src/components/Modal/Wrapper.js +0 -32
- package/src/components/Modal/Wrapper.test.js +0 -55
- package/src/components/Modal/index.js +0 -22
- package/src/components/MultiSelector.js +0 -104
- package/src/components/MultiSelector.test.js +0 -348
- package/src/components/Navigation/Bar.js +0 -212
- package/src/components/Navigation/Bar.test.js +0 -552
- package/src/components/Navigation/Tab.js +0 -156
- package/src/components/Navigation/Tab.test.js +0 -404
- package/src/components/Placeholder.js +0 -61
- package/src/components/Placeholder.test.js +0 -106
- package/src/components/Scope/Selector.js +0 -70
- package/src/components/Scope/Selector.test.js +0 -138
- package/src/components/Selector.js +0 -191
- package/src/components/Selector.test.js +0 -157
- package/src/components/Switch.js +0 -112
- package/src/components/Switch.test.js +0 -130
- package/src/components/Text.test.js +0 -132
- package/src/components/Toolbar.js +0 -178
- package/src/components/Toolbar.test.js +0 -478
- package/src/components/Tooltip.js +0 -51
- package/src/components/Tooltip.test.js +0 -21
- package/src/getTheme.js +0 -98
- package/src/getTheme.test.js +0 -92
- package/src/getThemeOverrides.js +0 -27
- package/src/hocs/withAuthentication.js +0 -18
- package/src/hocs/withAuthentication.test.js +0 -120
- package/src/utils/styledPropFuncs.js +0 -20
- 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 {
|
|
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
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
+
<TestWrapper stylesProvider muiThemeProvider={{ theme }}>
|
|
26
|
+
<Wrap>
|
|
27
|
+
<RootNode thing="stuff" />
|
|
28
|
+
</Wrap>
|
|
29
|
+
</TestWrapper>,
|
|
25
30
|
"when mounted",
|
|
26
31
|
"to satisfy",
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
<
|
|
37
|
-
<
|
|
38
|
-
|
|
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
|
-
<
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
<
|
|
66
|
-
<
|
|
67
|
-
|
|
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
|
-
<
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
<
|
|
82
|
-
<
|
|
83
|
-
|
|
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
|
-
<
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
<
|
|
98
|
-
<
|
|
99
|
-
|
|
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
|
-
<
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
<
|
|
113
|
-
<
|
|
114
|
-
|
|
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
|
-
<
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
<
|
|
128
|
-
<
|
|
129
|
-
|
|
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:
|
|
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
|
-
<
|
|
138
|
-
<
|
|
139
|
-
|
|
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:
|
|
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
|
-
<
|
|
172
|
-
<
|
|
173
|
-
|
|
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
|
-
<
|
|
182
|
-
<
|
|
183
|
-
|
|
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
|
-
<
|
|
190
|
-
<
|
|
191
|
-
<
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
<
|
|
208
|
-
<
|
|
209
|
-
|
|
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
|
-
<
|
|
216
|
-
<
|
|
217
|
-
<
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
<
|
|
233
|
-
<
|
|
234
|
-
|
|
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
|
-
<
|
|
241
|
-
<
|
|
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
|
-
<
|
|
251
|
-
<
|
|
286
|
+
<BeforeIndicator />
|
|
287
|
+
<Indicator open />
|
|
288
|
+
<Label>
|
|
289
|
+
<Ignore />
|
|
290
|
+
</Label>
|
|
252
291
|
</Leaf>
|
|
253
|
-
|
|
254
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
274
|
-
<
|
|
275
|
-
|
|
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
|
-
<
|
|
281
|
-
<
|
|
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
|
-
<
|
|
291
|
-
<
|
|
330
|
+
<BeforeIndicator />
|
|
331
|
+
<Indicator open />
|
|
332
|
+
<Label isSelectedNode={true}>
|
|
333
|
+
<Ignore />
|
|
334
|
+
</Label>
|
|
292
335
|
</Leaf>
|
|
293
|
-
|
|
294
|
-
|
|
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
|
-
<
|
|
302
|
-
<
|
|
303
|
-
|
|
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
|
-
<
|
|
310
|
-
<
|
|
311
|
-
<
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
<
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
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
|
-
<
|
|
332
|
-
<
|
|
333
|
-
|
|
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
|
-
<
|
|
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
|
-
<
|
|
404
|
-
<
|
|
405
|
-
|
|
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
|
-
<
|
|
412
|
-
<
|
|
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
|
-
<
|
|
422
|
-
<
|
|
477
|
+
<BeforeIndicator />
|
|
478
|
+
<Indicator open />
|
|
479
|
+
<Label>
|
|
480
|
+
<Ignore />
|
|
481
|
+
</Label>
|
|
423
482
|
</Leaf>
|
|
424
|
-
|
|
425
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
444
|
-
<
|
|
445
|
-
|
|
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
|
-
<
|
|
452
|
-
<
|
|
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
|
-
<
|
|
462
|
-
<
|
|
463
|
-
<
|
|
521
|
+
<BeforeIndicator />
|
|
522
|
+
<Indicator open />
|
|
523
|
+
<Label>
|
|
524
|
+
<Ignore />
|
|
525
|
+
</Label>
|
|
464
526
|
</Leaf>
|
|
465
527
|
<Branch>
|
|
466
|
-
<
|
|
528
|
+
<Leaf>
|
|
529
|
+
<Ignore />
|
|
530
|
+
<Ignore />
|
|
531
|
+
<Ignore />
|
|
532
|
+
</Leaf>
|
|
533
|
+
<Branch>
|
|
534
|
+
<Ignore />
|
|
535
|
+
</Branch>
|
|
467
536
|
</Branch>
|
|
468
|
-
</
|
|
469
|
-
</
|
|
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
|
-
|
|
548
|
+
"[data-qa='branch']",
|
|
480
549
|
"to contain",
|
|
481
550
|
<PropStruct id="hasKids" other="info" open={true} foo={true} bar={false} />,
|
|
482
551
|
),
|