@pie-lib/graphing-solution-set 4.0.13 → 4.1.0-beta
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/CHANGELOG.md +0 -44
- package/lib/__tests__/bg.test.js +282 -0
- package/lib/__tests__/bg.test.js.map +1 -0
- package/lib/__tests__/coordinates-label.test.js +276 -0
- package/lib/__tests__/coordinates-label.test.js.map +1 -0
- package/lib/__tests__/graph-with-controls.test.js +256 -0
- package/lib/__tests__/graph-with-controls.test.js.map +1 -0
- package/lib/__tests__/graph.test.js +113 -0
- package/lib/__tests__/graph.test.js.map +1 -0
- package/lib/__tests__/grid-setup.test.js +729 -0
- package/lib/__tests__/grid-setup.test.js.map +1 -0
- package/lib/__tests__/grid.test.js +29 -0
- package/lib/__tests__/grid.test.js.map +1 -0
- package/lib/__tests__/labels.test.js +45 -0
- package/lib/__tests__/labels.test.js.map +1 -0
- package/lib/__tests__/mark-label.test.js +133 -0
- package/lib/__tests__/mark-label.test.js.map +1 -0
- package/lib/__tests__/toggle-bar.test.js +146 -0
- package/lib/__tests__/toggle-bar.test.js.map +1 -0
- package/lib/__tests__/tool-menu.test.js +540 -0
- package/lib/__tests__/tool-menu.test.js.map +1 -0
- package/lib/__tests__/undo-redo.test.js +31 -0
- package/lib/__tests__/undo-redo.test.js.map +1 -0
- package/lib/__tests__/use-debounce.test.js +24 -0
- package/lib/__tests__/use-debounce.test.js.map +1 -0
- package/lib/__tests__/utils.js +70 -0
- package/lib/__tests__/utils.js.map +1 -0
- package/lib/__tests__/utils.test.js +123 -0
- package/lib/__tests__/utils.test.js.map +1 -0
- package/lib/axis/__tests__/arrow.test.js +60 -0
- package/lib/axis/__tests__/arrow.test.js.map +1 -0
- package/lib/axis/__tests__/axes.test.js +160 -0
- package/lib/axis/__tests__/axes.test.js.map +1 -0
- package/lib/container/__tests__/actions.test.js +108 -0
- package/lib/container/__tests__/actions.test.js.map +1 -0
- package/lib/container/__tests__/index.test.js +346 -0
- package/lib/container/__tests__/index.test.js.map +1 -0
- package/lib/container/__tests__/marks.test.js +259 -0
- package/lib/container/__tests__/marks.test.js.map +1 -0
- package/lib/container/__tests__/middleware.test.js +244 -0
- package/lib/container/__tests__/middleware.test.js.map +1 -0
- package/lib/container/__tests__/reducer.test.js +450 -0
- package/lib/container/__tests__/reducer.test.js.map +1 -0
- package/lib/tools/line/__tests__/component.test.js +45 -0
- package/lib/tools/line/__tests__/component.test.js.map +1 -0
- package/lib/tools/polygon/__tests__/component.test.js +501 -0
- package/lib/tools/polygon/__tests__/component.test.js.map +1 -0
- package/lib/tools/polygon/__tests__/index.test.js +92 -0
- package/lib/tools/polygon/__tests__/index.test.js.map +1 -0
- package/lib/tools/polygon/__tests__/line.test.js +30 -0
- package/lib/tools/polygon/__tests__/line.test.js.map +1 -0
- package/lib/tools/polygon/__tests__/polygon.test.js +61 -0
- package/lib/tools/polygon/__tests__/polygon.test.js.map +1 -0
- package/lib/tools/shared/__tests__/arrow-head.test.js +45 -0
- package/lib/tools/shared/__tests__/arrow-head.test.js.map +1 -0
- package/lib/tools/shared/line/__tests__/index.test.js +725 -0
- package/lib/tools/shared/line/__tests__/index.test.js.map +1 -0
- package/lib/tools/shared/line/__tests__/line-path.test.js +64 -0
- package/lib/tools/shared/line/__tests__/line-path.test.js.map +1 -0
- package/lib/tools/shared/line/__tests__/with-root-edge.test.js +618 -0
- package/lib/tools/shared/line/__tests__/with-root-edge.test.js.map +1 -0
- package/lib/tools/shared/point/__tests__/arrow-point.test.js +127 -0
- package/lib/tools/shared/point/__tests__/arrow-point.test.js.map +1 -0
- package/lib/tools/shared/point/__tests__/arrow.test.js +619 -0
- package/lib/tools/shared/point/__tests__/arrow.test.js.map +1 -0
- package/lib/tools/shared/point/__tests__/base-point.test.js +122 -0
- package/lib/tools/shared/point/__tests__/base-point.test.js.map +1 -0
- package/package.json +7 -7
- package/LICENSE.md +0 -5
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
5
|
+
var _reducer = _interopRequireDefault(require("../reducer"));
|
|
6
|
+
var _actions = require("../actions");
|
|
7
|
+
describe('container reducer', function () {
|
|
8
|
+
describe('reducer creation', function () {
|
|
9
|
+
it('creates a reducer function', function () {
|
|
10
|
+
var rootReducer = (0, _reducer["default"])();
|
|
11
|
+
expect((0, _typeof2["default"])(rootReducer)).toBe('function');
|
|
12
|
+
});
|
|
13
|
+
it('returns an object with marks property', function () {
|
|
14
|
+
var rootReducer = (0, _reducer["default"])();
|
|
15
|
+
var state = rootReducer(undefined, {
|
|
16
|
+
type: 'INIT'
|
|
17
|
+
});
|
|
18
|
+
expect(state).toHaveProperty('marks');
|
|
19
|
+
});
|
|
20
|
+
it('wraps marks reducer with undoable', function () {
|
|
21
|
+
var rootReducer = (0, _reducer["default"])();
|
|
22
|
+
var state = rootReducer(undefined, {
|
|
23
|
+
type: 'INIT'
|
|
24
|
+
});
|
|
25
|
+
expect(state.marks).toHaveProperty('past');
|
|
26
|
+
expect(state.marks).toHaveProperty('present');
|
|
27
|
+
expect(state.marks).toHaveProperty('future');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
describe('initial state', function () {
|
|
31
|
+
it('initializes with empty past', function () {
|
|
32
|
+
var rootReducer = (0, _reducer["default"])();
|
|
33
|
+
var state = rootReducer(undefined, {
|
|
34
|
+
type: 'INIT'
|
|
35
|
+
});
|
|
36
|
+
expect(state.marks.past).toEqual([]);
|
|
37
|
+
});
|
|
38
|
+
it('initializes with empty present', function () {
|
|
39
|
+
var rootReducer = (0, _reducer["default"])();
|
|
40
|
+
var state = rootReducer(undefined, {
|
|
41
|
+
type: 'INIT'
|
|
42
|
+
});
|
|
43
|
+
expect(state.marks.present).toEqual([]);
|
|
44
|
+
});
|
|
45
|
+
it('initializes with empty future', function () {
|
|
46
|
+
var rootReducer = (0, _reducer["default"])();
|
|
47
|
+
var state = rootReducer(undefined, {
|
|
48
|
+
type: 'INIT'
|
|
49
|
+
});
|
|
50
|
+
expect(state.marks.future).toEqual([]);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
describe('CHANGE_MARKS action', function () {
|
|
54
|
+
it('updates present with new marks', function () {
|
|
55
|
+
var rootReducer = (0, _reducer["default"])();
|
|
56
|
+
var newMarks = [{
|
|
57
|
+
id: 1,
|
|
58
|
+
type: 'point',
|
|
59
|
+
x: 5,
|
|
60
|
+
y: 10
|
|
61
|
+
}];
|
|
62
|
+
var action = (0, _actions.changeMarks)(newMarks);
|
|
63
|
+
var state = rootReducer(undefined, {
|
|
64
|
+
type: '@@INIT'
|
|
65
|
+
});
|
|
66
|
+
state = rootReducer(state, action);
|
|
67
|
+
expect(state.marks.present).toEqual(newMarks);
|
|
68
|
+
});
|
|
69
|
+
it('adds previous state to past', function () {
|
|
70
|
+
var rootReducer = (0, _reducer["default"])();
|
|
71
|
+
var firstMarks = [{
|
|
72
|
+
id: 1,
|
|
73
|
+
type: 'point'
|
|
74
|
+
}];
|
|
75
|
+
var secondMarks = [{
|
|
76
|
+
id: 2,
|
|
77
|
+
type: 'line'
|
|
78
|
+
}];
|
|
79
|
+
var state = rootReducer(undefined, {
|
|
80
|
+
type: '@@INIT'
|
|
81
|
+
});
|
|
82
|
+
state = rootReducer(state, (0, _actions.changeMarks)(firstMarks));
|
|
83
|
+
state = rootReducer(state, (0, _actions.changeMarks)(secondMarks));
|
|
84
|
+
expect(state.marks.past.length).toBeGreaterThan(0);
|
|
85
|
+
expect(state.marks.present).toEqual(secondMarks);
|
|
86
|
+
});
|
|
87
|
+
it('clears future on new action', function () {
|
|
88
|
+
var rootReducer = (0, _reducer["default"])();
|
|
89
|
+
var firstMarks = [{
|
|
90
|
+
id: 1,
|
|
91
|
+
type: 'point'
|
|
92
|
+
}];
|
|
93
|
+
var secondMarks = [{
|
|
94
|
+
id: 2,
|
|
95
|
+
type: 'line'
|
|
96
|
+
}];
|
|
97
|
+
var thirdMarks = [{
|
|
98
|
+
id: 3,
|
|
99
|
+
type: 'circle'
|
|
100
|
+
}];
|
|
101
|
+
var state = rootReducer(undefined, {
|
|
102
|
+
type: '@@INIT'
|
|
103
|
+
});
|
|
104
|
+
state = rootReducer(state, (0, _actions.changeMarks)(firstMarks));
|
|
105
|
+
state = rootReducer(state, (0, _actions.changeMarks)(secondMarks));
|
|
106
|
+
state = rootReducer(state, {
|
|
107
|
+
type: '@@redux-undo/UNDO'
|
|
108
|
+
});
|
|
109
|
+
expect(state.marks.future.length).toBeGreaterThan(0);
|
|
110
|
+
state = rootReducer(state, (0, _actions.changeMarks)(thirdMarks));
|
|
111
|
+
expect(state.marks.future).toEqual([]);
|
|
112
|
+
});
|
|
113
|
+
it('handles empty marks array', function () {
|
|
114
|
+
var rootReducer = (0, _reducer["default"])();
|
|
115
|
+
var action = (0, _actions.changeMarks)([]);
|
|
116
|
+
var state = rootReducer(undefined, {
|
|
117
|
+
type: '@@INIT'
|
|
118
|
+
});
|
|
119
|
+
state = rootReducer(state, action);
|
|
120
|
+
expect(state.marks.present).toEqual([]);
|
|
121
|
+
});
|
|
122
|
+
it('handles multiple marks', function () {
|
|
123
|
+
var rootReducer = (0, _reducer["default"])();
|
|
124
|
+
var marks = [{
|
|
125
|
+
id: 1,
|
|
126
|
+
type: 'point',
|
|
127
|
+
x: 1,
|
|
128
|
+
y: 2
|
|
129
|
+
}, {
|
|
130
|
+
id: 2,
|
|
131
|
+
type: 'line',
|
|
132
|
+
from: {
|
|
133
|
+
x: 0,
|
|
134
|
+
y: 0
|
|
135
|
+
},
|
|
136
|
+
to: {
|
|
137
|
+
x: 5,
|
|
138
|
+
y: 5
|
|
139
|
+
}
|
|
140
|
+
}, {
|
|
141
|
+
id: 3,
|
|
142
|
+
type: 'circle',
|
|
143
|
+
center: {
|
|
144
|
+
x: 3,
|
|
145
|
+
y: 3
|
|
146
|
+
},
|
|
147
|
+
radius: 2
|
|
148
|
+
}];
|
|
149
|
+
var action = (0, _actions.changeMarks)(marks);
|
|
150
|
+
var state = rootReducer(undefined, {
|
|
151
|
+
type: '@@INIT'
|
|
152
|
+
});
|
|
153
|
+
state = rootReducer(state, action);
|
|
154
|
+
expect(state.marks.present).toEqual(marks);
|
|
155
|
+
expect(state.marks.present.length).toBe(3);
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
describe('undo functionality', function () {
|
|
159
|
+
it('supports undo action', function () {
|
|
160
|
+
var rootReducer = (0, _reducer["default"])();
|
|
161
|
+
var firstMarks = [{
|
|
162
|
+
id: 1,
|
|
163
|
+
type: 'point'
|
|
164
|
+
}];
|
|
165
|
+
var secondMarks = [{
|
|
166
|
+
id: 2,
|
|
167
|
+
type: 'line'
|
|
168
|
+
}];
|
|
169
|
+
var state = rootReducer(undefined, {
|
|
170
|
+
type: '@@INIT'
|
|
171
|
+
});
|
|
172
|
+
state = rootReducer(state, (0, _actions.changeMarks)(firstMarks));
|
|
173
|
+
state = rootReducer(state, (0, _actions.changeMarks)(secondMarks));
|
|
174
|
+
state = rootReducer(state, {
|
|
175
|
+
type: '@@redux-undo/UNDO'
|
|
176
|
+
});
|
|
177
|
+
expect(state.marks.present).toEqual(firstMarks);
|
|
178
|
+
});
|
|
179
|
+
it('moves present to future on undo', function () {
|
|
180
|
+
var rootReducer = (0, _reducer["default"])();
|
|
181
|
+
var firstMarks = [{
|
|
182
|
+
id: 1,
|
|
183
|
+
type: 'point'
|
|
184
|
+
}];
|
|
185
|
+
var secondMarks = [{
|
|
186
|
+
id: 2,
|
|
187
|
+
type: 'line'
|
|
188
|
+
}];
|
|
189
|
+
var state = rootReducer(undefined, {
|
|
190
|
+
type: '@@INIT'
|
|
191
|
+
});
|
|
192
|
+
state = rootReducer(state, (0, _actions.changeMarks)(firstMarks));
|
|
193
|
+
state = rootReducer(state, (0, _actions.changeMarks)(secondMarks));
|
|
194
|
+
state = rootReducer(state, {
|
|
195
|
+
type: '@@redux-undo/UNDO'
|
|
196
|
+
});
|
|
197
|
+
expect(state.marks.future.length).toBeGreaterThan(0);
|
|
198
|
+
});
|
|
199
|
+
it('handles multiple undos', function () {
|
|
200
|
+
var rootReducer = (0, _reducer["default"])();
|
|
201
|
+
var marks1 = [{
|
|
202
|
+
id: 1
|
|
203
|
+
}];
|
|
204
|
+
var marks2 = [{
|
|
205
|
+
id: 2
|
|
206
|
+
}];
|
|
207
|
+
var marks3 = [{
|
|
208
|
+
id: 3
|
|
209
|
+
}];
|
|
210
|
+
var state = rootReducer(undefined, {
|
|
211
|
+
type: '@@INIT'
|
|
212
|
+
});
|
|
213
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks1));
|
|
214
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks2));
|
|
215
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks3));
|
|
216
|
+
state = rootReducer(state, {
|
|
217
|
+
type: '@@redux-undo/UNDO'
|
|
218
|
+
});
|
|
219
|
+
state = rootReducer(state, {
|
|
220
|
+
type: '@@redux-undo/UNDO'
|
|
221
|
+
});
|
|
222
|
+
expect(state.marks.present).toEqual(marks1);
|
|
223
|
+
});
|
|
224
|
+
it('does not undo beyond initial state', function () {
|
|
225
|
+
var rootReducer = (0, _reducer["default"])();
|
|
226
|
+
var marks = [{
|
|
227
|
+
id: 1,
|
|
228
|
+
type: 'point'
|
|
229
|
+
}];
|
|
230
|
+
var state = rootReducer(undefined, {
|
|
231
|
+
type: '@@INIT'
|
|
232
|
+
});
|
|
233
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks));
|
|
234
|
+
state = rootReducer(state, {
|
|
235
|
+
type: '@@redux-undo/UNDO'
|
|
236
|
+
});
|
|
237
|
+
state = rootReducer(state, {
|
|
238
|
+
type: '@@redux-undo/UNDO'
|
|
239
|
+
});
|
|
240
|
+
state = rootReducer(state, {
|
|
241
|
+
type: '@@redux-undo/UNDO'
|
|
242
|
+
});
|
|
243
|
+
expect(state.marks.present).toEqual([]);
|
|
244
|
+
expect(state.marks.past).toEqual([]);
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
describe('redo functionality', function () {
|
|
248
|
+
it('supports redo action', function () {
|
|
249
|
+
var rootReducer = (0, _reducer["default"])();
|
|
250
|
+
var firstMarks = [{
|
|
251
|
+
id: 1,
|
|
252
|
+
type: 'point'
|
|
253
|
+
}];
|
|
254
|
+
var secondMarks = [{
|
|
255
|
+
id: 2,
|
|
256
|
+
type: 'line'
|
|
257
|
+
}];
|
|
258
|
+
var state = rootReducer(undefined, {
|
|
259
|
+
type: '@@INIT'
|
|
260
|
+
});
|
|
261
|
+
state = rootReducer(state, (0, _actions.changeMarks)(firstMarks));
|
|
262
|
+
state = rootReducer(state, (0, _actions.changeMarks)(secondMarks));
|
|
263
|
+
state = rootReducer(state, {
|
|
264
|
+
type: '@@redux-undo/UNDO'
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
// Redo
|
|
268
|
+
state = rootReducer(state, {
|
|
269
|
+
type: '@@redux-undo/REDO'
|
|
270
|
+
});
|
|
271
|
+
expect(state.marks.present).toEqual(secondMarks);
|
|
272
|
+
});
|
|
273
|
+
it('moves future to past on redo', function () {
|
|
274
|
+
var rootReducer = (0, _reducer["default"])();
|
|
275
|
+
var firstMarks = [{
|
|
276
|
+
id: 1,
|
|
277
|
+
type: 'point'
|
|
278
|
+
}];
|
|
279
|
+
var secondMarks = [{
|
|
280
|
+
id: 2,
|
|
281
|
+
type: 'line'
|
|
282
|
+
}];
|
|
283
|
+
var state = rootReducer(undefined, {
|
|
284
|
+
type: '@@INIT'
|
|
285
|
+
});
|
|
286
|
+
state = rootReducer(state, (0, _actions.changeMarks)(firstMarks));
|
|
287
|
+
state = rootReducer(state, (0, _actions.changeMarks)(secondMarks));
|
|
288
|
+
state = rootReducer(state, {
|
|
289
|
+
type: '@@redux-undo/UNDO'
|
|
290
|
+
});
|
|
291
|
+
var futureBeforeRedo = state.marks.future.length;
|
|
292
|
+
state = rootReducer(state, {
|
|
293
|
+
type: '@@redux-undo/REDO'
|
|
294
|
+
});
|
|
295
|
+
expect(state.marks.future.length).toBe(futureBeforeRedo - 1);
|
|
296
|
+
});
|
|
297
|
+
it('handles multiple redos', function () {
|
|
298
|
+
var rootReducer = (0, _reducer["default"])();
|
|
299
|
+
var marks1 = [{
|
|
300
|
+
id: 1
|
|
301
|
+
}];
|
|
302
|
+
var marks2 = [{
|
|
303
|
+
id: 2
|
|
304
|
+
}];
|
|
305
|
+
var marks3 = [{
|
|
306
|
+
id: 3
|
|
307
|
+
}];
|
|
308
|
+
var state = rootReducer(undefined, {
|
|
309
|
+
type: '@@INIT'
|
|
310
|
+
});
|
|
311
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks1));
|
|
312
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks2));
|
|
313
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks3));
|
|
314
|
+
|
|
315
|
+
// undo twice, then redo twice
|
|
316
|
+
state = rootReducer(state, {
|
|
317
|
+
type: '@@redux-undo/UNDO'
|
|
318
|
+
});
|
|
319
|
+
state = rootReducer(state, {
|
|
320
|
+
type: '@@redux-undo/UNDO'
|
|
321
|
+
});
|
|
322
|
+
state = rootReducer(state, {
|
|
323
|
+
type: '@@redux-undo/REDO'
|
|
324
|
+
});
|
|
325
|
+
state = rootReducer(state, {
|
|
326
|
+
type: '@@redux-undo/REDO'
|
|
327
|
+
});
|
|
328
|
+
expect(state.marks.present).toEqual(marks3);
|
|
329
|
+
});
|
|
330
|
+
it('does not redo beyond last state', function () {
|
|
331
|
+
var rootReducer = (0, _reducer["default"])();
|
|
332
|
+
var marks = [{
|
|
333
|
+
id: 1,
|
|
334
|
+
type: 'point'
|
|
335
|
+
}];
|
|
336
|
+
var state = rootReducer(undefined, {
|
|
337
|
+
type: '@@INIT'
|
|
338
|
+
});
|
|
339
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks));
|
|
340
|
+
state = rootReducer(state, {
|
|
341
|
+
type: '@@redux-undo/UNDO'
|
|
342
|
+
});
|
|
343
|
+
state = rootReducer(state, {
|
|
344
|
+
type: '@@redux-undo/REDO'
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
// try to redo beyond the end
|
|
348
|
+
state = rootReducer(state, {
|
|
349
|
+
type: '@@redux-undo/REDO'
|
|
350
|
+
});
|
|
351
|
+
state = rootReducer(state, {
|
|
352
|
+
type: '@@redux-undo/REDO'
|
|
353
|
+
});
|
|
354
|
+
expect(state.marks.present).toEqual(marks);
|
|
355
|
+
expect(state.marks.future).toEqual([]);
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
describe('state structure', function () {
|
|
359
|
+
it('maintains correct undoable structure', function () {
|
|
360
|
+
var rootReducer = (0, _reducer["default"])();
|
|
361
|
+
var state = rootReducer(undefined, {
|
|
362
|
+
type: 'INIT'
|
|
363
|
+
});
|
|
364
|
+
expect(state.marks).toHaveProperty('past');
|
|
365
|
+
expect(state.marks).toHaveProperty('present');
|
|
366
|
+
expect(state.marks).toHaveProperty('future');
|
|
367
|
+
expect(Array.isArray(state.marks.past)).toBe(true);
|
|
368
|
+
expect(Array.isArray(state.marks.future)).toBe(true);
|
|
369
|
+
});
|
|
370
|
+
it('preserves mark properties through undo/redo', function () {
|
|
371
|
+
var rootReducer = (0, _reducer["default"])();
|
|
372
|
+
var marks = [{
|
|
373
|
+
id: 1,
|
|
374
|
+
type: 'point',
|
|
375
|
+
x: 10,
|
|
376
|
+
y: 20,
|
|
377
|
+
label: 'A',
|
|
378
|
+
correctness: {
|
|
379
|
+
value: 'correct'
|
|
380
|
+
}
|
|
381
|
+
}];
|
|
382
|
+
var state = rootReducer(undefined, {
|
|
383
|
+
type: 'INIT'
|
|
384
|
+
});
|
|
385
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks));
|
|
386
|
+
state = rootReducer(state, (0, _actions.changeMarks)([]));
|
|
387
|
+
state = rootReducer(state, {
|
|
388
|
+
type: '@@redux-undo/UNDO'
|
|
389
|
+
});
|
|
390
|
+
expect(state.marks.present).toEqual(marks);
|
|
391
|
+
expect(state.marks.present[0]).toBeDefined();
|
|
392
|
+
if (state.marks.present[0]) {
|
|
393
|
+
expect(state.marks.present[0]).toEqual(marks[0]);
|
|
394
|
+
expect(state.marks.present[0].correctness).toBeDefined();
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
});
|
|
398
|
+
describe('integration', function () {
|
|
399
|
+
it('handles complex undo/redo sequences', function () {
|
|
400
|
+
var rootReducer = (0, _reducer["default"])();
|
|
401
|
+
var marks1 = [{
|
|
402
|
+
id: 1
|
|
403
|
+
}];
|
|
404
|
+
var marks2 = [{
|
|
405
|
+
id: 2
|
|
406
|
+
}];
|
|
407
|
+
var marks3 = [{
|
|
408
|
+
id: 3
|
|
409
|
+
}];
|
|
410
|
+
var marks4 = [{
|
|
411
|
+
id: 4
|
|
412
|
+
}];
|
|
413
|
+
var state = rootReducer(undefined, {
|
|
414
|
+
type: '@@INIT'
|
|
415
|
+
});
|
|
416
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks1));
|
|
417
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks2));
|
|
418
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks3));
|
|
419
|
+
state = rootReducer(state, {
|
|
420
|
+
type: '@@redux-undo/UNDO'
|
|
421
|
+
}); // back to marks2
|
|
422
|
+
state = rootReducer(state, {
|
|
423
|
+
type: '@@redux-undo/UNDO'
|
|
424
|
+
}); // back to marks1
|
|
425
|
+
state = rootReducer(state, {
|
|
426
|
+
type: '@@redux-undo/REDO'
|
|
427
|
+
}); // forward to marks2
|
|
428
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks4));
|
|
429
|
+
expect(state.marks.present).toEqual(marks4);
|
|
430
|
+
expect(state.marks.future).toEqual([]);
|
|
431
|
+
});
|
|
432
|
+
it('works with empty state transitions', function () {
|
|
433
|
+
var rootReducer = (0, _reducer["default"])();
|
|
434
|
+
var marks = [{
|
|
435
|
+
id: 1
|
|
436
|
+
}];
|
|
437
|
+
var state = rootReducer(undefined, {
|
|
438
|
+
type: '@@INIT'
|
|
439
|
+
});
|
|
440
|
+
state = rootReducer(state, (0, _actions.changeMarks)([]));
|
|
441
|
+
state = rootReducer(state, (0, _actions.changeMarks)(marks));
|
|
442
|
+
state = rootReducer(state, (0, _actions.changeMarks)([]));
|
|
443
|
+
state = rootReducer(state, {
|
|
444
|
+
type: '@@redux-undo/UNDO'
|
|
445
|
+
});
|
|
446
|
+
expect(state.marks.present).toEqual(marks);
|
|
447
|
+
});
|
|
448
|
+
});
|
|
449
|
+
});
|
|
450
|
+
//# sourceMappingURL=reducer.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducer.test.js","names":["_reducer","_interopRequireDefault","require","_actions","describe","it","rootReducer","reducer","expect","_typeof2","toBe","state","undefined","type","toHaveProperty","marks","past","toEqual","present","future","newMarks","id","x","y","action","changeMarks","firstMarks","secondMarks","length","toBeGreaterThan","thirdMarks","from","to","center","radius","marks1","marks2","marks3","futureBeforeRedo","Array","isArray","label","correctness","value","toBeDefined","marks4"],"sources":["../../../src/container/__tests__/reducer.test.js"],"sourcesContent":["import reducer from '../reducer';\nimport { changeMarks } from '../actions';\n\ndescribe('container reducer', () => {\n describe('reducer creation', () => {\n it('creates a reducer function', () => {\n const rootReducer = reducer();\n expect(typeof rootReducer).toBe('function');\n });\n\n it('returns an object with marks property', () => {\n const rootReducer = reducer();\n const state = rootReducer(undefined, { type: 'INIT' });\n expect(state).toHaveProperty('marks');\n });\n\n it('wraps marks reducer with undoable', () => {\n const rootReducer = reducer();\n const state = rootReducer(undefined, { type: 'INIT' });\n\n expect(state.marks).toHaveProperty('past');\n expect(state.marks).toHaveProperty('present');\n expect(state.marks).toHaveProperty('future');\n });\n });\n\n describe('initial state', () => {\n it('initializes with empty past', () => {\n const rootReducer = reducer();\n const state = rootReducer(undefined, { type: 'INIT' });\n\n expect(state.marks.past).toEqual([]);\n });\n\n it('initializes with empty present', () => {\n const rootReducer = reducer();\n const state = rootReducer(undefined, { type: 'INIT' });\n\n expect(state.marks.present).toEqual([]);\n });\n\n it('initializes with empty future', () => {\n const rootReducer = reducer();\n const state = rootReducer(undefined, { type: 'INIT' });\n\n expect(state.marks.future).toEqual([]);\n });\n });\n\n describe('CHANGE_MARKS action', () => {\n it('updates present with new marks', () => {\n const rootReducer = reducer();\n const newMarks = [{ id: 1, type: 'point', x: 5, y: 10 }];\n const action = changeMarks(newMarks);\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, action);\n\n expect(state.marks.present).toEqual(newMarks);\n });\n\n it('adds previous state to past', () => {\n const rootReducer = reducer();\n const firstMarks = [{ id: 1, type: 'point' }];\n const secondMarks = [{ id: 2, type: 'line' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(firstMarks));\n state = rootReducer(state, changeMarks(secondMarks));\n\n expect(state.marks.past.length).toBeGreaterThan(0);\n expect(state.marks.present).toEqual(secondMarks);\n });\n\n it('clears future on new action', () => {\n const rootReducer = reducer();\n const firstMarks = [{ id: 1, type: 'point' }];\n const secondMarks = [{ id: 2, type: 'line' }];\n const thirdMarks = [{ id: 3, type: 'circle' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(firstMarks));\n state = rootReducer(state, changeMarks(secondMarks));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.future.length).toBeGreaterThan(0);\n\n state = rootReducer(state, changeMarks(thirdMarks));\n expect(state.marks.future).toEqual([]);\n });\n\n it('handles empty marks array', () => {\n const rootReducer = reducer();\n const action = changeMarks([]);\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, action);\n\n expect(state.marks.present).toEqual([]);\n });\n\n it('handles multiple marks', () => {\n const rootReducer = reducer();\n const marks = [\n { id: 1, type: 'point', x: 1, y: 2 },\n { id: 2, type: 'line', from: { x: 0, y: 0 }, to: { x: 5, y: 5 } },\n { id: 3, type: 'circle', center: { x: 3, y: 3 }, radius: 2 },\n ];\n const action = changeMarks(marks);\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, action);\n\n expect(state.marks.present).toEqual(marks);\n expect(state.marks.present.length).toBe(3);\n });\n });\n\n describe('undo functionality', () => {\n it('supports undo action', () => {\n const rootReducer = reducer();\n const firstMarks = [{ id: 1, type: 'point' }];\n const secondMarks = [{ id: 2, type: 'line' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(firstMarks));\n state = rootReducer(state, changeMarks(secondMarks));\n\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.present).toEqual(firstMarks);\n });\n\n it('moves present to future on undo', () => {\n const rootReducer = reducer();\n const firstMarks = [{ id: 1, type: 'point' }];\n const secondMarks = [{ id: 2, type: 'line' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(firstMarks));\n state = rootReducer(state, changeMarks(secondMarks));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.future.length).toBeGreaterThan(0);\n });\n\n it('handles multiple undos', () => {\n const rootReducer = reducer();\n const marks1 = [{ id: 1 }];\n const marks2 = [{ id: 2 }];\n const marks3 = [{ id: 3 }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(marks1));\n state = rootReducer(state, changeMarks(marks2));\n state = rootReducer(state, changeMarks(marks3));\n\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.present).toEqual(marks1);\n });\n\n it('does not undo beyond initial state', () => {\n const rootReducer = reducer();\n const marks = [{ id: 1, type: 'point' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(marks));\n\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.present).toEqual([]);\n expect(state.marks.past).toEqual([]);\n });\n });\n\n describe('redo functionality', () => {\n it('supports redo action', () => {\n const rootReducer = reducer();\n const firstMarks = [{ id: 1, type: 'point' }];\n const secondMarks = [{ id: 2, type: 'line' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(firstMarks));\n state = rootReducer(state, changeMarks(secondMarks));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n // Redo\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n\n expect(state.marks.present).toEqual(secondMarks);\n });\n\n it('moves future to past on redo', () => {\n const rootReducer = reducer();\n const firstMarks = [{ id: 1, type: 'point' }];\n const secondMarks = [{ id: 2, type: 'line' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(firstMarks));\n state = rootReducer(state, changeMarks(secondMarks));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n const futureBeforeRedo = state.marks.future.length;\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n\n expect(state.marks.future.length).toBe(futureBeforeRedo - 1);\n });\n\n it('handles multiple redos', () => {\n const rootReducer = reducer();\n const marks1 = [{ id: 1 }];\n const marks2 = [{ id: 2 }];\n const marks3 = [{ id: 3 }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(marks1));\n state = rootReducer(state, changeMarks(marks2));\n state = rootReducer(state, changeMarks(marks3));\n\n // undo twice, then redo twice\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n\n expect(state.marks.present).toEqual(marks3);\n });\n\n it('does not redo beyond last state', () => {\n const rootReducer = reducer();\n const marks = [{ id: 1, type: 'point' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(marks));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n\n // try to redo beyond the end\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n\n expect(state.marks.present).toEqual(marks);\n expect(state.marks.future).toEqual([]);\n });\n });\n\n describe('state structure', () => {\n it('maintains correct undoable structure', () => {\n const rootReducer = reducer();\n const state = rootReducer(undefined, { type: 'INIT' });\n\n expect(state.marks).toHaveProperty('past');\n expect(state.marks).toHaveProperty('present');\n expect(state.marks).toHaveProperty('future');\n expect(Array.isArray(state.marks.past)).toBe(true);\n expect(Array.isArray(state.marks.future)).toBe(true);\n });\n\n it('preserves mark properties through undo/redo', () => {\n const rootReducer = reducer();\n const marks = [\n {\n id: 1,\n type: 'point',\n x: 10,\n y: 20,\n label: 'A',\n correctness: { value: 'correct' },\n },\n ];\n\n let state = rootReducer(undefined, { type: 'INIT' });\n state = rootReducer(state, changeMarks(marks));\n state = rootReducer(state, changeMarks([]));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.present).toEqual(marks);\n expect(state.marks.present[0]).toBeDefined();\n if (state.marks.present[0]) {\n expect(state.marks.present[0]).toEqual(marks[0]);\n expect(state.marks.present[0].correctness).toBeDefined();\n }\n });\n });\n\n describe('integration', () => {\n it('handles complex undo/redo sequences', () => {\n const rootReducer = reducer();\n const marks1 = [{ id: 1 }];\n const marks2 = [{ id: 2 }];\n const marks3 = [{ id: 3 }];\n const marks4 = [{ id: 4 }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(marks1));\n state = rootReducer(state, changeMarks(marks2));\n state = rootReducer(state, changeMarks(marks3));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' }); // back to marks2\n state = rootReducer(state, { type: '@@redux-undo/UNDO' }); // back to marks1\n state = rootReducer(state, { type: '@@redux-undo/REDO' }); // forward to marks2\n state = rootReducer(state, changeMarks(marks4));\n\n expect(state.marks.present).toEqual(marks4);\n expect(state.marks.future).toEqual([]);\n });\n\n it('works with empty state transitions', () => {\n const rootReducer = reducer();\n const marks = [{ id: 1 }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks([]));\n state = rootReducer(state, changeMarks(marks));\n state = rootReducer(state, changeMarks([]));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.present).toEqual(marks);\n });\n });\n});\n"],"mappings":";;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEAE,QAAQ,CAAC,mBAAmB,EAAE,YAAM;EAClCA,QAAQ,CAAC,kBAAkB,EAAE,YAAM;IACjCC,EAAE,CAAC,4BAA4B,EAAE,YAAM;MACrC,IAAMC,WAAW,GAAG,IAAAC,mBAAO,EAAC,CAAC;MAC7BC,MAAM,KAAAC,QAAA,aAAQH,WAAW,EAAC,CAACI,IAAI,CAAC,UAAU,CAAC;IAC7C,CAAC,CAAC;IAEFL,EAAE,CAAC,uCAAuC,EAAE,YAAM;MAChD,IAAMC,WAAW,GAAG,IAAAC,mBAAO,EAAC,CAAC;MAC7B,IAAMI,KAAK,GAAGL,WAAW,CAACM,SAAS,EAAE;QAAEC,IAAI,EAAE;MAAO,CAAC,CAAC;MACtDL,MAAM,CAACG,KAAK,CAAC,CAACG,cAAc,CAAC,OAAO,CAAC;IACvC,CAAC,CAAC;IAEFT,EAAE,CAAC,mCAAmC,EAAE,YAAM;MAC5C,IAAMC,WAAW,GAAG,IAAAC,mBAAO,EAAC,CAAC;MAC7B,IAAMI,KAAK,GAAGL,WAAW,CAACM,SAAS,EAAE;QAAEC,IAAI,EAAE;MAAO,CAAC,CAAC;MAEtDL,MAAM,CAACG,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ireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
5
|
+
var _testUtils = require("@pie-lib/test-utils");
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _component = require("../component");
|
|
8
|
+
var _utils = require("../../../__tests__/utils");
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
jest.mock('@pie-lib/plot', function () {
|
|
12
|
+
var a = jest.requireActual('@pie-lib/plot');
|
|
13
|
+
return {
|
|
14
|
+
types: a.types,
|
|
15
|
+
gridDraggable: a.gridDraggable,
|
|
16
|
+
utils: a.utils,
|
|
17
|
+
trig: {
|
|
18
|
+
edges: jest.fn(function () {
|
|
19
|
+
return jest.fn().mockReturnValue([0, 0]);
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
describe('ArrowedLine', function () {
|
|
25
|
+
var onChange = jest.fn();
|
|
26
|
+
var renderComponent = function renderComponent(extras) {
|
|
27
|
+
var defaults = {
|
|
28
|
+
classes: {},
|
|
29
|
+
className: 'className',
|
|
30
|
+
onChange: onChange,
|
|
31
|
+
markerId: '1',
|
|
32
|
+
graphProps: (0, _utils.graphProps)()
|
|
33
|
+
};
|
|
34
|
+
var props = _objectSpread(_objectSpread({}, defaults), extras);
|
|
35
|
+
return (0, _testUtils.render)(/*#__PURE__*/_react["default"].createElement(_component.ArrowedLine, props));
|
|
36
|
+
};
|
|
37
|
+
describe('rendering', function () {
|
|
38
|
+
it('renders without crashing', function () {
|
|
39
|
+
var _renderComponent = renderComponent(),
|
|
40
|
+
container = _renderComponent.container;
|
|
41
|
+
expect(container.firstChild).toBeInTheDocument();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=component.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.test.js","names":["_testUtils","require","_react","_interopRequireDefault","_component","_utils","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","jest","mock","a","requireActual","types","gridDraggable","utils","trig","edges","fn","mockReturnValue","describe","onChange","renderComponent","extras","defaults","classes","className","markerId","graphProps","getGraphProps","props","render","createElement","ArrowedLine","it","_renderComponent","container","expect","firstChild","toBeInTheDocument"],"sources":["../../../../src/tools/line/__tests__/component.test.jsx"],"sourcesContent":["import { render } from '@pie-lib/test-utils';\nimport React from 'react';\nimport { ArrowedLine } from '../component';\nimport { graphProps as getGraphProps } from '../../../__tests__/utils';\n\njest.mock('@pie-lib/plot', () => {\n const a = jest.requireActual('@pie-lib/plot');\n return {\n types: a.types,\n gridDraggable: a.gridDraggable,\n utils: a.utils,\n trig: {\n edges: jest.fn(() => jest.fn().mockReturnValue([0, 0])),\n },\n };\n});\n\ndescribe('ArrowedLine', () => {\n let onChange = jest.fn();\n const renderComponent = (extras) => {\n const defaults = {\n classes: {},\n className: 'className',\n onChange,\n markerId: '1',\n graphProps: getGraphProps(),\n };\n const props = { ...defaults, ...extras };\n return render(<ArrowedLine {...props} />);\n };\n describe('rendering', () => {\n it('renders without crashing', () => {\n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