Fixes tests

This commit is contained in:
Steve Ruiz 2021-07-14 12:40:18 +01:00
parent 43276c700f
commit 6ce1f0b5f1
3 changed files with 68 additions and 218 deletions

View file

@ -41,14 +41,8 @@
"name": "Rectangle", "name": "Rectangle",
"parentId": "page1", "parentId": "page1",
"childIndex": 3, "childIndex": 3,
"point": [ "point": [171.47, 288.63],
171.47, "size": [176.22, 192.26],
288.63
],
"size": [
176.22,
192.26
],
"radius": 2, "radius": 2,
"rotation": 0, "rotation": 0,
"style": { "style": {
@ -64,14 +58,8 @@
"name": "Rectangle", "name": "Rectangle",
"parentId": "page1", "parentId": "page1",
"childIndex": 4, "childIndex": 4,
"point": [ "point": [511.7, 404.19],
511.7, "size": [181.08999999999992, 150.40999999999997],
404.19
],
"size": [
181.08999999999992,
150.40999999999997
],
"radius": 2, "radius": 2,
"rotation": 0, "rotation": 0,
"style": { "style": {
@ -87,14 +75,8 @@
"name": "Rectangle", "name": "Rectangle",
"parentId": "page1", "parentId": "page1",
"childIndex": 5, "childIndex": 5,
"point": [ "point": [384.09, 378.45],
384.09, "size": [95.20999999999992, 91.1799999999999],
378.45
],
"size": [
95.20999999999992,
91.1799999999999
],
"radius": 2, "radius": 2,
"rotation": 0, "rotation": 0,
"style": { "style": {
@ -110,10 +92,7 @@
"name": "Ellipse", "name": "Ellipse",
"parentId": "page1", "parentId": "page1",
"childIndex": 6, "childIndex": 6,
"point": [ "point": [162.45, 679.23],
162.45,
679.23
],
"radiusX": 102.99999999999997, "radiusX": 102.99999999999997,
"radiusY": 102.99999999999994, "radiusY": 102.99999999999994,
"rotation": 0, "rotation": 0,
@ -130,10 +109,7 @@
"name": "Ellipse", "name": "Ellipse",
"parentId": "page1", "parentId": "page1",
"childIndex": 7, "childIndex": 7,
"point": [ "point": [517.18, 783.54],
517.18,
783.54
],
"radiusX": 102.99999999999997, "radiusX": 102.99999999999997,
"radiusY": 102.99999999999994, "radiusY": 102.99999999999994,
"rotation": 0, "rotation": 0,
@ -150,10 +126,7 @@
"name": "Ellipse", "name": "Ellipse",
"parentId": "page1", "parentId": "page1",
"childIndex": 8, "childIndex": 8,
"point": [ "point": [398.99, 810.79],
398.99,
810.79
],
"radiusX": 45.484999999999985, "radiusX": 45.484999999999985,
"radiusY": 45.48499999999996, "radiusY": 45.48499999999996,
"rotation": 0, "rotation": 0,
@ -170,36 +143,24 @@
"name": "Arrow", "name": "Arrow",
"parentId": "page1", "parentId": "page1",
"childIndex": 9, "childIndex": 9,
"point": [ "point": [252.85, 1057.5],
252.85,
1057.5
],
"rotation": 0, "rotation": 0,
"bend": 0, "bend": 0,
"handles": { "handles": {
"start": { "start": {
"id": "start", "id": "start",
"index": 0, "index": 0,
"point": [ "point": [0, 0]
0,
0
]
}, },
"end": { "end": {
"id": "end", "id": "end",
"index": 1, "index": 1,
"point": [ "point": [0.09000000000000341, 208]
0.09000000000000341,
208
]
}, },
"bend": { "bend": {
"id": "bend", "id": "bend",
"index": 2, "index": 2,
"point": [ "point": [0.045000000000001705, 104]
0.045000000000001705,
104
]
} }
}, },
"decorations": { "decorations": {
@ -220,36 +181,24 @@
"name": "Arrow", "name": "Arrow",
"parentId": "page1", "parentId": "page1",
"childIndex": 10, "childIndex": 10,
"point": [ "point": [616.9, 1124.3],
616.9,
1124.3
],
"rotation": 0, "rotation": 0,
"bend": 0, "bend": 0,
"handles": { "handles": {
"start": { "start": {
"id": "start", "id": "start",
"index": 0, "index": 0,
"point": [ "point": [0, 0]
0,
0
]
}, },
"end": { "end": {
"id": "end", "id": "end",
"index": 1, "index": 1,
"point": [ "point": [2.4500000000000455, 185.20000000000005]
2.4500000000000455,
185.20000000000005
]
}, },
"bend": { "bend": {
"id": "bend", "id": "bend",
"index": 2, "index": 2,
"point": [ "point": [1.2250000000000227, 92.60000000000002]
1.2250000000000227,
92.60000000000002
]
} }
}, },
"decorations": { "decorations": {
@ -270,36 +219,24 @@
"name": "Arrow", "name": "Arrow",
"parentId": "page1", "parentId": "page1",
"childIndex": 11, "childIndex": 11,
"point": [ "point": [425.18, 1143.2],
425.18,
1143.2
],
"rotation": 0, "rotation": 0,
"bend": 0, "bend": 0,
"handles": { "handles": {
"start": { "start": {
"id": "start", "id": "start",
"index": 0, "index": 0,
"point": [ "point": [0, 0]
0,
0
]
}, },
"end": { "end": {
"id": "end", "id": "end",
"index": 1, "index": 1,
"point": [ "point": [1.8500000000000227, 95.70000000000005]
1.8500000000000227,
95.70000000000005
]
}, },
"bend": { "bend": {
"id": "bend", "id": "bend",
"index": 2, "index": 2,
"point": [ "point": [0.9250000000000114, 47.85000000000002]
0.9250000000000114,
47.85000000000002
]
} }
}, },
"decorations": { "decorations": {
@ -320,10 +257,7 @@
"name": "Text", "name": "Text",
"parentId": "page1", "parentId": "page1",
"childIndex": 12, "childIndex": 12,
"point": [ "point": [207.16, 1422.4],
207.16,
1422.4
],
"rotation": 0, "rotation": 0,
"style": { "style": {
"color": "Black", "color": "Black",
@ -340,10 +274,7 @@
"name": "Text", "name": "Text",
"parentId": "page1", "parentId": "page1",
"childIndex": 13, "childIndex": 13,
"point": [ "point": [389.57, 1496.5],
389.57,
1496.5
],
"rotation": 0, "rotation": 0,
"style": { "style": {
"color": "Black", "color": "Black",
@ -360,10 +291,7 @@
"name": "Text", "name": "Text",
"parentId": "page1", "parentId": "page1",
"childIndex": 14, "childIndex": 14,
"point": [ "point": [564.06, 1558.1],
564.06,
1558.1
],
"rotation": 0, "rotation": 0,
"style": { "style": {
"color": "Black", "color": "Black",
@ -389,10 +317,7 @@
"page1": { "page1": {
"id": "page1", "id": "page1",
"camera": { "camera": {
"point": [ "point": [0, -145],
0,
-145
],
"zoom": 1 "zoom": 1
}, },
"selectedIds": {} "selectedIds": {}

View file

@ -15,14 +15,8 @@
"name": "Rectangle", "name": "Rectangle",
"parentId": "page1", "parentId": "page1",
"childIndex": 3, "childIndex": 3,
"point": [ "point": [100, 100],
100, "size": [100, 100],
100
],
"size": [
100,
100
],
"radius": 2, "radius": 2,
"rotation": 0, "rotation": 0,
"style": { "style": {
@ -38,14 +32,8 @@
"name": "Rectangle", "name": "Rectangle",
"parentId": "page1", "parentId": "page1",
"childIndex": 4, "childIndex": 4,
"point": [ "point": [500, 400],
500, "size": [200, 200],
400
],
"size": [
200,
200
],
"radius": 2, "radius": 2,
"rotation": 0, "rotation": 0,
"style": { "style": {
@ -61,14 +49,8 @@
"name": "Rectangle", "name": "Rectangle",
"parentId": "page1", "parentId": "page1",
"childIndex": 5, "childIndex": 5,
"point": [ "point": [384.09, 378.45],
384.09, "size": [95.20999999999992, 91.1799999999999],
378.45
],
"size": [
95.20999999999992,
91.1799999999999
],
"radius": 2, "radius": 2,
"rotation": 0, "rotation": 0,
"style": { "style": {
@ -84,10 +66,7 @@
"name": "Ellipse", "name": "Ellipse",
"parentId": "page1", "parentId": "page1",
"childIndex": 6, "childIndex": 6,
"point": [ "point": [162.45, 679.23],
162.45,
679.23
],
"radiusX": 102.99999999999997, "radiusX": 102.99999999999997,
"radiusY": 102.99999999999994, "radiusY": 102.99999999999994,
"rotation": 0, "rotation": 0,
@ -104,10 +83,7 @@
"name": "Ellipse", "name": "Ellipse",
"parentId": "page1", "parentId": "page1",
"childIndex": 7, "childIndex": 7,
"point": [ "point": [517.18, 783.54],
517.18,
783.54
],
"radiusX": 102.99999999999997, "radiusX": 102.99999999999997,
"radiusY": 102.99999999999994, "radiusY": 102.99999999999994,
"rotation": 0, "rotation": 0,
@ -124,10 +100,7 @@
"name": "Ellipse", "name": "Ellipse",
"parentId": "page1", "parentId": "page1",
"childIndex": 8, "childIndex": 8,
"point": [ "point": [398.99, 810.79],
398.99,
810.79
],
"radiusX": 45.484999999999985, "radiusX": 45.484999999999985,
"radiusY": 45.48499999999996, "radiusY": 45.48499999999996,
"rotation": 0, "rotation": 0,
@ -144,36 +117,24 @@
"name": "Arrow", "name": "Arrow",
"parentId": "page1", "parentId": "page1",
"childIndex": 9, "childIndex": 9,
"point": [ "point": [252.85, 1057.5],
252.85,
1057.5
],
"rotation": 0, "rotation": 0,
"bend": 0, "bend": 0,
"handles": { "handles": {
"start": { "start": {
"id": "start", "id": "start",
"index": 0, "index": 0,
"point": [ "point": [0, 0]
0,
0
]
}, },
"end": { "end": {
"id": "end", "id": "end",
"index": 1, "index": 1,
"point": [ "point": [0.09000000000000341, 208]
0.09000000000000341,
208
]
}, },
"bend": { "bend": {
"id": "bend", "id": "bend",
"index": 2, "index": 2,
"point": [ "point": [0.045000000000001705, 104]
0.045000000000001705,
104
]
} }
}, },
"decorations": { "decorations": {
@ -194,36 +155,24 @@
"name": "Arrow", "name": "Arrow",
"parentId": "page1", "parentId": "page1",
"childIndex": 10, "childIndex": 10,
"point": [ "point": [616.9, 1124.3],
616.9,
1124.3
],
"rotation": 0, "rotation": 0,
"bend": 0, "bend": 0,
"handles": { "handles": {
"start": { "start": {
"id": "start", "id": "start",
"index": 0, "index": 0,
"point": [ "point": [0, 0]
0,
0
]
}, },
"end": { "end": {
"id": "end", "id": "end",
"index": 1, "index": 1,
"point": [ "point": [2.4500000000000455, 185.20000000000005]
2.4500000000000455,
185.20000000000005
]
}, },
"bend": { "bend": {
"id": "bend", "id": "bend",
"index": 2, "index": 2,
"point": [ "point": [1.2250000000000227, 92.60000000000002]
1.2250000000000227,
92.60000000000002
]
} }
}, },
"decorations": { "decorations": {
@ -244,36 +193,24 @@
"name": "Arrow", "name": "Arrow",
"parentId": "page1", "parentId": "page1",
"childIndex": 11, "childIndex": 11,
"point": [ "point": [425.18, 1143.2],
425.18,
1143.2
],
"rotation": 0, "rotation": 0,
"bend": 0, "bend": 0,
"handles": { "handles": {
"start": { "start": {
"id": "start", "id": "start",
"index": 0, "index": 0,
"point": [ "point": [0, 0]
0,
0
]
}, },
"end": { "end": {
"id": "end", "id": "end",
"index": 1, "index": 1,
"point": [ "point": [1.8500000000000227, 95.70000000000005]
1.8500000000000227,
95.70000000000005
]
}, },
"bend": { "bend": {
"id": "bend", "id": "bend",
"index": 2, "index": 2,
"point": [ "point": [0.9250000000000114, 47.85000000000002]
0.9250000000000114,
47.85000000000002
]
} }
}, },
"decorations": { "decorations": {
@ -294,10 +231,7 @@
"name": "Text", "name": "Text",
"parentId": "page1", "parentId": "page1",
"childIndex": 12, "childIndex": 12,
"point": [ "point": [207.16, 1422.4],
207.16,
1422.4
],
"rotation": 0, "rotation": 0,
"style": { "style": {
"color": "Black", "color": "Black",
@ -314,10 +248,7 @@
"name": "Text", "name": "Text",
"parentId": "page1", "parentId": "page1",
"childIndex": 13, "childIndex": 13,
"point": [ "point": [389.57, 1496.5],
389.57,
1496.5
],
"rotation": 0, "rotation": 0,
"style": { "style": {
"color": "Black", "color": "Black",
@ -334,10 +265,7 @@
"name": "Text", "name": "Text",
"parentId": "page1", "parentId": "page1",
"childIndex": 14, "childIndex": 14,
"point": [ "point": [564.06, 1558.1],
564.06,
1558.1
],
"rotation": 0, "rotation": 0,
"style": { "style": {
"color": "Black", "color": "Black",
@ -362,10 +290,7 @@
"pageState": { "pageState": {
"id": "page1", "id": "page1",
"camera": { "camera": {
"point": [ "point": [0, -145],
0,
-145
],
"zoom": 1 "zoom": 1
}, },
"selectedIds": {} "selectedIds": {}

View file

@ -26,30 +26,30 @@ describe('rename page command', () => {
}) })
}) })
// describe('renames a page other than the current page', () => { describe('renames a page other than the current page', () => {
// tt.restore() tt.restore()
// .reset() .reset()
// .send('CREATED_PAGE') .send('CREATED_PAGE')
// .send('CHANGED_PAGE', { id: 'page1' }) .send('CHANGED_PAGE', { id: 'page1' })
// expect(Object.keys(tt.data.document.pages).length).toBe(2) expect(Object.keys(tt.data.document.pages).length).toBe(2)
// expect(tt.data.currentPageId).toBe('page1') expect(tt.data.currentPageId).toBe('page1')
// const secondPageId = Object.keys(tt.data.document.pages)[1] const secondPageId = Object.keys(tt.data.document.pages)[1]
// expect(tt.data.document.pages[secondPageId].name).toBe('New Page') expect(tt.data.document.pages[secondPageId].name).toBe('Page 2')
// tt.send('RENAMED_PAGE', { id: secondPageId, name: 'My Second Page' }) tt.send('RENAMED_PAGE', { id: secondPageId, name: 'My Second Page' })
// expect(tt.data.document.pages[secondPageId].name).toBe('My Second Page') expect(tt.data.document.pages[secondPageId].name).toBe('My Second Page')
// tt.undo() tt.undo()
// expect(tt.data.document.pages[secondPageId].name).toBe('New Page') expect(tt.data.document.pages[secondPageId].name).toBe('Page 2')
// tt.redo() tt.redo()
// expect(tt.data.document.pages[secondPageId].name).toBe('My Second Page') expect(tt.data.document.pages[secondPageId].name).toBe('My Second Page')
// }) })
}) })