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,13 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Immutable from "immutable";
|
|
3
|
-
import { MemoryRouter } from "react-router-dom";
|
|
4
|
-
import { Provider } from "react-redux";
|
|
5
3
|
import sinon from "sinon";
|
|
6
|
-
import {
|
|
4
|
+
import { spyOnConsole, TestWrapper } from "../../utils/testUtils";
|
|
7
5
|
import Treeview from "./index";
|
|
8
6
|
import { Branch, Wrapper } from "./Branch";
|
|
9
7
|
import { Leaf, Root } from "./Leaf";
|
|
10
8
|
import { Label, Indicator, BeforeIndicator, NonIndicator } from "./Label";
|
|
9
|
+
import { createMuiTheme } from "../../utils/testUtils";
|
|
10
|
+
|
|
11
|
+
const theme = createMuiTheme();
|
|
11
12
|
|
|
12
13
|
const TestNode = ({ id, updateNodeState, testVal, ...props }) => (
|
|
13
14
|
<div {...props} id={id} onClick={() => updateNodeState(testVal)} />
|
|
@@ -61,175 +62,175 @@ describe("TreeView", () => {
|
|
|
61
62
|
it("renders empty node contents if Content prop absent", () => {
|
|
62
63
|
delete testProps.Content;
|
|
63
64
|
expect(
|
|
64
|
-
<
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
</MemoryRouter>
|
|
68
|
-
</Provider>,
|
|
65
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
66
|
+
<Treeview {...testProps} />
|
|
67
|
+
</TestWrapper>,
|
|
69
68
|
"when mounted",
|
|
70
69
|
"to satisfy",
|
|
71
|
-
<
|
|
72
|
-
<
|
|
73
|
-
<
|
|
74
|
-
</Root>
|
|
75
|
-
<Branch>
|
|
76
|
-
<Leaf>
|
|
77
|
-
<BeforeIndicator />
|
|
78
|
-
<Indicator />
|
|
79
|
-
<Label />
|
|
80
|
-
</Leaf>
|
|
81
|
-
<Leaf>
|
|
82
|
-
<NonIndicator />
|
|
70
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }}>
|
|
71
|
+
<Wrapper>
|
|
72
|
+
<Root>
|
|
83
73
|
<Label />
|
|
84
|
-
</
|
|
85
|
-
|
|
86
|
-
|
|
74
|
+
</Root>
|
|
75
|
+
<Branch>
|
|
76
|
+
<Leaf>
|
|
77
|
+
<BeforeIndicator />
|
|
78
|
+
<Indicator />
|
|
79
|
+
<Label />
|
|
80
|
+
</Leaf>
|
|
81
|
+
<Leaf>
|
|
82
|
+
<NonIndicator />
|
|
83
|
+
<Label />
|
|
84
|
+
</Leaf>
|
|
85
|
+
</Branch>
|
|
86
|
+
</Wrapper>
|
|
87
|
+
</TestWrapper>,
|
|
87
88
|
).then(() => expect(console.warn, "was called"));
|
|
88
89
|
});
|
|
89
90
|
|
|
90
91
|
it("renders an empty wrapper if missing getNode", () => {
|
|
91
92
|
delete testProps.getNode;
|
|
92
93
|
return expect(
|
|
93
|
-
<
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
</MemoryRouter>
|
|
97
|
-
</Provider>,
|
|
94
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
95
|
+
<Treeview {...testProps} />
|
|
96
|
+
</TestWrapper>,
|
|
98
97
|
"when mounted",
|
|
99
98
|
"to satisfy",
|
|
100
|
-
<
|
|
99
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
100
|
+
<Wrapper />
|
|
101
|
+
</TestWrapper>,
|
|
101
102
|
).then(() => expect(console.warn, "was called"));
|
|
102
103
|
});
|
|
103
104
|
});
|
|
104
105
|
|
|
105
106
|
it("shows a tree root and first level of child nodes", () =>
|
|
106
107
|
expect(
|
|
107
|
-
<
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
</MemoryRouter>
|
|
111
|
-
</Provider>,
|
|
108
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
109
|
+
<Treeview {...testProps} />
|
|
110
|
+
</TestWrapper>,
|
|
112
111
|
"when mounted",
|
|
113
112
|
"to satisfy",
|
|
114
|
-
<
|
|
115
|
-
<
|
|
116
|
-
<
|
|
117
|
-
<div id="root1" />
|
|
118
|
-
</Label>
|
|
119
|
-
</Root>
|
|
120
|
-
<Branch>
|
|
121
|
-
<Leaf>
|
|
122
|
-
<BeforeIndicator />
|
|
123
|
-
<Indicator />
|
|
124
|
-
<Label>
|
|
125
|
-
<div id="testNode1" />
|
|
126
|
-
</Label>
|
|
127
|
-
</Leaf>
|
|
128
|
-
<Leaf>
|
|
129
|
-
<NonIndicator />
|
|
113
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
114
|
+
<Wrapper>
|
|
115
|
+
<Root>
|
|
130
116
|
<Label>
|
|
131
|
-
<div id="
|
|
117
|
+
<div id="root1" />
|
|
132
118
|
</Label>
|
|
133
|
-
</
|
|
134
|
-
|
|
135
|
-
|
|
119
|
+
</Root>
|
|
120
|
+
<Branch>
|
|
121
|
+
<Leaf>
|
|
122
|
+
<BeforeIndicator />
|
|
123
|
+
<Indicator />
|
|
124
|
+
<Label>
|
|
125
|
+
<div id="testNode1" />
|
|
126
|
+
</Label>
|
|
127
|
+
</Leaf>
|
|
128
|
+
<Leaf>
|
|
129
|
+
<NonIndicator />
|
|
130
|
+
<Label>
|
|
131
|
+
<div id="testNode2" />
|
|
132
|
+
</Label>
|
|
133
|
+
</Leaf>
|
|
134
|
+
</Branch>
|
|
135
|
+
</Wrapper>
|
|
136
|
+
</TestWrapper>,
|
|
136
137
|
));
|
|
137
138
|
|
|
138
139
|
it("shows open nodes according to a default state", () =>
|
|
139
140
|
expect(
|
|
140
|
-
<
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
</MemoryRouter>
|
|
144
|
-
</Provider>,
|
|
141
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
142
|
+
<Treeview {...testProps} defaultNodeState={{ testNode1: true }} />
|
|
143
|
+
</TestWrapper>,
|
|
145
144
|
"when mounted",
|
|
146
145
|
"to satisfy",
|
|
147
|
-
<
|
|
148
|
-
<
|
|
149
|
-
<
|
|
150
|
-
<div id="root1" />
|
|
151
|
-
</Label>
|
|
152
|
-
</Root>
|
|
153
|
-
<Branch>
|
|
154
|
-
<Leaf>
|
|
155
|
-
<BeforeIndicator />
|
|
156
|
-
<Indicator open />
|
|
146
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
147
|
+
<Wrapper>
|
|
148
|
+
<Root>
|
|
157
149
|
<Label>
|
|
158
|
-
<div id="
|
|
150
|
+
<div id="root1" />
|
|
159
151
|
</Label>
|
|
160
|
-
</
|
|
152
|
+
</Root>
|
|
161
153
|
<Branch>
|
|
162
154
|
<Leaf>
|
|
163
155
|
<BeforeIndicator />
|
|
164
|
-
<Indicator />
|
|
156
|
+
<Indicator open />
|
|
165
157
|
<Label>
|
|
166
|
-
<div id="
|
|
158
|
+
<div id="testNode1" />
|
|
167
159
|
</Label>
|
|
168
160
|
</Leaf>
|
|
161
|
+
<Branch>
|
|
162
|
+
<Leaf>
|
|
163
|
+
<BeforeIndicator />
|
|
164
|
+
<Indicator />
|
|
165
|
+
<Label>
|
|
166
|
+
<div id="testNode3" />
|
|
167
|
+
</Label>
|
|
168
|
+
</Leaf>
|
|
169
|
+
<Leaf>
|
|
170
|
+
<NonIndicator />
|
|
171
|
+
<Label>
|
|
172
|
+
<div id="testNode4" />
|
|
173
|
+
</Label>
|
|
174
|
+
</Leaf>
|
|
175
|
+
</Branch>
|
|
169
176
|
<Leaf>
|
|
170
177
|
<NonIndicator />
|
|
171
178
|
<Label>
|
|
172
|
-
<div id="
|
|
179
|
+
<div id="testNode2" />
|
|
173
180
|
</Label>
|
|
174
181
|
</Leaf>
|
|
175
182
|
</Branch>
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
<Label>
|
|
179
|
-
<div id="testNode2" />
|
|
180
|
-
</Label>
|
|
181
|
-
</Leaf>
|
|
182
|
-
</Branch>
|
|
183
|
-
</Wrapper>,
|
|
183
|
+
</Wrapper>
|
|
184
|
+
</TestWrapper>,
|
|
184
185
|
));
|
|
185
186
|
|
|
186
187
|
it("shows an open branch according to view state", () => {
|
|
187
188
|
state = state.setIn(["view", "testTree", "nodeState", "testNode1"], true);
|
|
188
189
|
return expect(
|
|
189
|
-
<
|
|
190
|
-
<
|
|
191
|
-
|
|
192
|
-
</MemoryRouter>
|
|
193
|
-
</Provider>,
|
|
190
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
191
|
+
<Treeview {...testProps} />
|
|
192
|
+
</TestWrapper>,
|
|
194
193
|
"when mounted",
|
|
195
194
|
"to satisfy",
|
|
196
|
-
<
|
|
197
|
-
<
|
|
198
|
-
<
|
|
199
|
-
<div id="root1" />
|
|
200
|
-
</Label>
|
|
201
|
-
</Root>
|
|
202
|
-
<Branch>
|
|
203
|
-
<Leaf>
|
|
204
|
-
<BeforeIndicator />
|
|
205
|
-
<Indicator open />
|
|
195
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
196
|
+
<Wrapper>
|
|
197
|
+
<Root>
|
|
206
198
|
<Label>
|
|
207
|
-
<div id="
|
|
199
|
+
<div id="root1" />
|
|
208
200
|
</Label>
|
|
209
|
-
</
|
|
201
|
+
</Root>
|
|
210
202
|
<Branch>
|
|
211
203
|
<Leaf>
|
|
212
204
|
<BeforeIndicator />
|
|
213
|
-
<Indicator />
|
|
205
|
+
<Indicator open />
|
|
214
206
|
<Label>
|
|
215
|
-
<div id="
|
|
207
|
+
<div id="testNode1" />
|
|
216
208
|
</Label>
|
|
217
209
|
</Leaf>
|
|
210
|
+
<Branch>
|
|
211
|
+
<Leaf>
|
|
212
|
+
<BeforeIndicator />
|
|
213
|
+
<Indicator />
|
|
214
|
+
<Label>
|
|
215
|
+
<div id="testNode3" />
|
|
216
|
+
</Label>
|
|
217
|
+
</Leaf>
|
|
218
|
+
<Leaf>
|
|
219
|
+
<NonIndicator />
|
|
220
|
+
<Label>
|
|
221
|
+
<div id="testNode4" />
|
|
222
|
+
</Label>
|
|
223
|
+
</Leaf>
|
|
224
|
+
</Branch>
|
|
218
225
|
<Leaf>
|
|
219
226
|
<NonIndicator />
|
|
220
227
|
<Label>
|
|
221
|
-
<div id="
|
|
228
|
+
<div id="testNode2" />
|
|
222
229
|
</Label>
|
|
223
230
|
</Leaf>
|
|
224
231
|
</Branch>
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
<Label>
|
|
228
|
-
<div id="testNode2" />
|
|
229
|
-
</Label>
|
|
230
|
-
</Leaf>
|
|
231
|
-
</Branch>
|
|
232
|
-
</Wrapper>,
|
|
232
|
+
</Wrapper>
|
|
233
|
+
</TestWrapper>,
|
|
233
234
|
);
|
|
234
235
|
});
|
|
235
236
|
|
|
@@ -237,126 +238,125 @@ describe("TreeView", () => {
|
|
|
237
238
|
state = state.setIn(["view", "testTree", "nodeState", "testNode1"], true);
|
|
238
239
|
testProps.selectedNodeId = "testNode1";
|
|
239
240
|
return expect(
|
|
240
|
-
<
|
|
241
|
-
<
|
|
242
|
-
|
|
243
|
-
</MemoryRouter>
|
|
244
|
-
</Provider>,
|
|
241
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
242
|
+
<Treeview {...testProps} />
|
|
243
|
+
</TestWrapper>,
|
|
245
244
|
"when mounted",
|
|
246
245
|
"to satisfy",
|
|
247
|
-
<
|
|
248
|
-
<
|
|
249
|
-
<
|
|
250
|
-
<
|
|
251
|
-
|
|
252
|
-
</Root>
|
|
253
|
-
<Branch>
|
|
254
|
-
<Leaf>
|
|
255
|
-
<BeforeIndicator />
|
|
256
|
-
<Indicator open />
|
|
257
|
-
<Label isSelectedNode={true}>
|
|
258
|
-
<div id="testNode1" />
|
|
246
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
247
|
+
<Wrapper>
|
|
248
|
+
<Root>
|
|
249
|
+
<Label>
|
|
250
|
+
<div id="root1" />
|
|
259
251
|
</Label>
|
|
260
|
-
</
|
|
252
|
+
</Root>
|
|
261
253
|
<Branch>
|
|
262
254
|
<Leaf>
|
|
263
255
|
<BeforeIndicator />
|
|
264
|
-
<Indicator />
|
|
265
|
-
<Label>
|
|
266
|
-
<div id="
|
|
256
|
+
<Indicator open />
|
|
257
|
+
<Label isSelectedNode={true}>
|
|
258
|
+
<div id="testNode1" />
|
|
267
259
|
</Label>
|
|
268
260
|
</Leaf>
|
|
261
|
+
<Branch>
|
|
262
|
+
<Leaf>
|
|
263
|
+
<BeforeIndicator />
|
|
264
|
+
<Indicator />
|
|
265
|
+
<Label>
|
|
266
|
+
<div id="testNode3" />
|
|
267
|
+
</Label>
|
|
268
|
+
</Leaf>
|
|
269
|
+
<Leaf>
|
|
270
|
+
<NonIndicator />
|
|
271
|
+
<Label>
|
|
272
|
+
<div id="testNode4" />
|
|
273
|
+
</Label>
|
|
274
|
+
</Leaf>
|
|
275
|
+
</Branch>
|
|
269
276
|
<Leaf>
|
|
270
277
|
<NonIndicator />
|
|
271
278
|
<Label>
|
|
272
|
-
<div id="
|
|
279
|
+
<div id="testNode2" />
|
|
273
280
|
</Label>
|
|
274
281
|
</Leaf>
|
|
275
282
|
</Branch>
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
<Label>
|
|
279
|
-
<div id="testNode2" />
|
|
280
|
-
</Label>
|
|
281
|
-
</Leaf>
|
|
282
|
-
</Branch>
|
|
283
|
-
</Wrapper>,
|
|
283
|
+
</Wrapper>
|
|
284
|
+
</TestWrapper>,
|
|
284
285
|
);
|
|
285
286
|
});
|
|
286
287
|
|
|
287
288
|
it("overrides default node state with view state", () => {
|
|
288
289
|
state = state.setIn(["view", "testTree", "nodeState", "testNode1"], false);
|
|
289
290
|
return expect(
|
|
290
|
-
<
|
|
291
|
-
<
|
|
292
|
-
|
|
293
|
-
</MemoryRouter>
|
|
294
|
-
</Provider>,
|
|
291
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
292
|
+
<Treeview {...testProps} defaultNodeState={{ testNode1: true }} />
|
|
293
|
+
</TestWrapper>,
|
|
295
294
|
"when mounted",
|
|
296
295
|
"to satisfy",
|
|
297
|
-
<
|
|
298
|
-
<
|
|
299
|
-
<
|
|
300
|
-
<div id="root1" />
|
|
301
|
-
</Label>
|
|
302
|
-
</Root>
|
|
303
|
-
<Branch>
|
|
304
|
-
<Leaf>
|
|
305
|
-
<BeforeIndicator />
|
|
306
|
-
<Indicator />
|
|
307
|
-
<Label>
|
|
308
|
-
<div id="testNode1" />
|
|
309
|
-
</Label>
|
|
310
|
-
</Leaf>
|
|
311
|
-
<Leaf>
|
|
312
|
-
<NonIndicator />
|
|
296
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
297
|
+
<Wrapper>
|
|
298
|
+
<Root>
|
|
313
299
|
<Label>
|
|
314
|
-
<div id="
|
|
300
|
+
<div id="root1" />
|
|
315
301
|
</Label>
|
|
316
|
-
</
|
|
317
|
-
|
|
318
|
-
|
|
302
|
+
</Root>
|
|
303
|
+
<Branch>
|
|
304
|
+
<Leaf>
|
|
305
|
+
<BeforeIndicator />
|
|
306
|
+
<Indicator />
|
|
307
|
+
<Label>
|
|
308
|
+
<div id="testNode1" />
|
|
309
|
+
</Label>
|
|
310
|
+
</Leaf>
|
|
311
|
+
<Leaf>
|
|
312
|
+
<NonIndicator />
|
|
313
|
+
<Label>
|
|
314
|
+
<div id="testNode2" />
|
|
315
|
+
</Label>
|
|
316
|
+
</Leaf>
|
|
317
|
+
</Branch>
|
|
318
|
+
</Wrapper>
|
|
319
|
+
</TestWrapper>,
|
|
319
320
|
);
|
|
320
321
|
});
|
|
321
322
|
|
|
322
323
|
it("updates view state on indicator click", () => {
|
|
323
324
|
state = state.setIn(["view", "testTree", "nodeState", "testNode3"], true);
|
|
324
325
|
return expect(
|
|
325
|
-
<
|
|
326
|
-
<
|
|
327
|
-
|
|
328
|
-
</MemoryRouter>
|
|
329
|
-
</Provider>,
|
|
326
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
327
|
+
<Treeview {...testProps} />
|
|
328
|
+
</TestWrapper>,
|
|
330
329
|
"when mounted",
|
|
331
330
|
"with event",
|
|
332
331
|
{
|
|
333
332
|
type: "click",
|
|
334
|
-
target:
|
|
335
|
-
getStyledClassSelector(Branch) + " " + getStyledClassSelector(Leaf) + " " + getStyledClassSelector(Indicator),
|
|
333
|
+
target: '[data-qa="branch"]' + " " + '[data-qa="leaf"]' + " " + '[data-qa="indicator"]',
|
|
336
334
|
},
|
|
337
335
|
"to satisfy",
|
|
338
|
-
<
|
|
339
|
-
<
|
|
340
|
-
<
|
|
341
|
-
<div id="root1" />
|
|
342
|
-
</Label>
|
|
343
|
-
</Root>
|
|
344
|
-
<Branch>
|
|
345
|
-
<Leaf>
|
|
346
|
-
<BeforeIndicator />
|
|
347
|
-
<Indicator />
|
|
348
|
-
<Label>
|
|
349
|
-
<div id="testNode1" />
|
|
350
|
-
</Label>
|
|
351
|
-
</Leaf>
|
|
352
|
-
<Leaf>
|
|
353
|
-
<NonIndicator />
|
|
336
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
337
|
+
<Wrapper>
|
|
338
|
+
<Root>
|
|
354
339
|
<Label>
|
|
355
|
-
<div id="
|
|
340
|
+
<div id="root1" />
|
|
356
341
|
</Label>
|
|
357
|
-
</
|
|
358
|
-
|
|
359
|
-
|
|
342
|
+
</Root>
|
|
343
|
+
<Branch>
|
|
344
|
+
<Leaf>
|
|
345
|
+
<BeforeIndicator />
|
|
346
|
+
<Indicator />
|
|
347
|
+
<Label>
|
|
348
|
+
<div id="testNode1" />
|
|
349
|
+
</Label>
|
|
350
|
+
</Leaf>
|
|
351
|
+
<Leaf>
|
|
352
|
+
<NonIndicator />
|
|
353
|
+
<Label>
|
|
354
|
+
<div id="testNode2" />
|
|
355
|
+
</Label>
|
|
356
|
+
</Leaf>
|
|
357
|
+
</Branch>
|
|
358
|
+
</Wrapper>
|
|
359
|
+
</TestWrapper>,
|
|
360
360
|
).then(() =>
|
|
361
361
|
expect(store.dispatch, "to have calls satisfying", [
|
|
362
362
|
{
|
|
@@ -380,113 +380,113 @@ describe("TreeView", () => {
|
|
|
380
380
|
|
|
381
381
|
it("shows all nodes if openAll flag is set", () =>
|
|
382
382
|
expect(
|
|
383
|
-
<
|
|
384
|
-
<
|
|
385
|
-
|
|
386
|
-
</MemoryRouter>
|
|
387
|
-
</Provider>,
|
|
383
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
384
|
+
<Treeview {...testProps} openAll />
|
|
385
|
+
</TestWrapper>,
|
|
388
386
|
"when mounted",
|
|
389
387
|
"to satisfy",
|
|
390
|
-
<
|
|
391
|
-
<
|
|
392
|
-
<
|
|
393
|
-
<div id="root1" />
|
|
394
|
-
</Label>
|
|
395
|
-
</Root>
|
|
396
|
-
<Branch>
|
|
397
|
-
<Leaf>
|
|
398
|
-
<BeforeIndicator />
|
|
399
|
-
<Indicator open />
|
|
388
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
389
|
+
<Wrapper>
|
|
390
|
+
<Root>
|
|
400
391
|
<Label>
|
|
401
|
-
<div id="
|
|
392
|
+
<div id="root1" />
|
|
402
393
|
</Label>
|
|
403
|
-
</
|
|
394
|
+
</Root>
|
|
404
395
|
<Branch>
|
|
405
396
|
<Leaf>
|
|
406
397
|
<BeforeIndicator />
|
|
407
398
|
<Indicator open />
|
|
408
399
|
<Label>
|
|
409
|
-
<div id="
|
|
400
|
+
<div id="testNode1" />
|
|
410
401
|
</Label>
|
|
411
402
|
</Leaf>
|
|
412
403
|
<Branch>
|
|
404
|
+
<Leaf>
|
|
405
|
+
<BeforeIndicator />
|
|
406
|
+
<Indicator open />
|
|
407
|
+
<Label>
|
|
408
|
+
<div id="testNode3" />
|
|
409
|
+
</Label>
|
|
410
|
+
</Leaf>
|
|
411
|
+
<Branch>
|
|
412
|
+
<Leaf>
|
|
413
|
+
<NonIndicator />
|
|
414
|
+
<Label>
|
|
415
|
+
<div id="testNode5" />
|
|
416
|
+
</Label>
|
|
417
|
+
</Leaf>
|
|
418
|
+
</Branch>
|
|
413
419
|
<Leaf>
|
|
414
420
|
<NonIndicator />
|
|
415
421
|
<Label>
|
|
416
|
-
<div id="
|
|
422
|
+
<div id="testNode4" />
|
|
417
423
|
</Label>
|
|
418
424
|
</Leaf>
|
|
419
425
|
</Branch>
|
|
420
426
|
<Leaf>
|
|
421
427
|
<NonIndicator />
|
|
422
428
|
<Label>
|
|
423
|
-
<div id="
|
|
429
|
+
<div id="testNode2" />
|
|
424
430
|
</Label>
|
|
425
431
|
</Leaf>
|
|
426
432
|
</Branch>
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
<Label>
|
|
430
|
-
<div id="testNode2" />
|
|
431
|
-
</Label>
|
|
432
|
-
</Leaf>
|
|
433
|
-
</Branch>
|
|
434
|
-
</Wrapper>,
|
|
433
|
+
</Wrapper>
|
|
434
|
+
</TestWrapper>,
|
|
435
435
|
));
|
|
436
436
|
|
|
437
437
|
it("passes unknown props to all nodes", () =>
|
|
438
438
|
expect(
|
|
439
|
-
<
|
|
440
|
-
<
|
|
441
|
-
|
|
442
|
-
</MemoryRouter>
|
|
443
|
-
</Provider>,
|
|
439
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
440
|
+
<Treeview {...testProps} openAll data-test-info="A test data variable" />
|
|
441
|
+
</TestWrapper>,
|
|
444
442
|
"when mounted",
|
|
445
443
|
"to satisfy",
|
|
446
|
-
<
|
|
447
|
-
<
|
|
448
|
-
<
|
|
449
|
-
<div id="root1" data-test-info="A test data variable" />
|
|
450
|
-
</Label>
|
|
451
|
-
</Root>
|
|
452
|
-
<Branch>
|
|
453
|
-
<Leaf>
|
|
454
|
-
<BeforeIndicator />
|
|
455
|
-
<Indicator open />
|
|
444
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }} memoryRouter={{}}>
|
|
445
|
+
<Wrapper>
|
|
446
|
+
<Root>
|
|
456
447
|
<Label>
|
|
457
|
-
<div id="
|
|
448
|
+
<div id="root1" data-test-info="A test data variable" />
|
|
458
449
|
</Label>
|
|
459
|
-
</
|
|
450
|
+
</Root>
|
|
460
451
|
<Branch>
|
|
461
452
|
<Leaf>
|
|
462
453
|
<BeforeIndicator />
|
|
463
454
|
<Indicator open />
|
|
464
455
|
<Label>
|
|
465
|
-
<div id="
|
|
456
|
+
<div id="testNode1" data-test-info="A test data variable" />
|
|
466
457
|
</Label>
|
|
467
458
|
</Leaf>
|
|
468
459
|
<Branch>
|
|
460
|
+
<Leaf>
|
|
461
|
+
<BeforeIndicator />
|
|
462
|
+
<Indicator open />
|
|
463
|
+
<Label>
|
|
464
|
+
<div id="testNode3" data-test-info="A test data variable" />
|
|
465
|
+
</Label>
|
|
466
|
+
</Leaf>
|
|
467
|
+
<Branch>
|
|
468
|
+
<Leaf>
|
|
469
|
+
<NonIndicator />
|
|
470
|
+
<Label>
|
|
471
|
+
<div id="testNode5" data-test-info="A test data variable" />
|
|
472
|
+
</Label>
|
|
473
|
+
</Leaf>
|
|
474
|
+
</Branch>
|
|
469
475
|
<Leaf>
|
|
470
476
|
<NonIndicator />
|
|
471
477
|
<Label>
|
|
472
|
-
<div id="
|
|
478
|
+
<div id="testNode4" data-test-info="A test data variable" />
|
|
473
479
|
</Label>
|
|
474
480
|
</Leaf>
|
|
475
481
|
</Branch>
|
|
476
482
|
<Leaf>
|
|
477
483
|
<NonIndicator />
|
|
478
484
|
<Label>
|
|
479
|
-
<div id="
|
|
485
|
+
<div id="testNode2" data-test-info="A test data variable" />
|
|
480
486
|
</Label>
|
|
481
487
|
</Leaf>
|
|
482
488
|
</Branch>
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
<Label>
|
|
486
|
-
<div id="testNode2" data-test-info="A test data variable" />
|
|
487
|
-
</Label>
|
|
488
|
-
</Leaf>
|
|
489
|
-
</Branch>
|
|
490
|
-
</Wrapper>,
|
|
489
|
+
</Wrapper>
|
|
490
|
+
</TestWrapper>,
|
|
491
491
|
));
|
|
492
492
|
});
|