2021-06-25 11:01:22 +00:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
2021-06-25 12:21:33 +00:00
|
|
|
exports[`selection creates a code control: generated code controls from code 1`] = `
|
|
|
|
Object {
|
|
|
|
"test-number-control": Object {
|
|
|
|
"id": "test-number-control",
|
|
|
|
"label": "x",
|
|
|
|
"step": 1,
|
|
|
|
"type": "number",
|
|
|
|
"value": 0,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
`;
|
2021-06-25 11:01:22 +00:00
|
|
|
|
2021-06-25 12:09:53 +00:00
|
|
|
exports[`selection generates a draw shape: generated draw from code 1`] = `
|
|
|
|
Array [
|
|
|
|
Object {
|
|
|
|
"childIndex": 1,
|
|
|
|
"id": "test-draw",
|
|
|
|
"isAspectRatioLocked": false,
|
|
|
|
"isGenerated": true,
|
|
|
|
"isHidden": false,
|
|
|
|
"isLocked": false,
|
|
|
|
"name": "Test draw",
|
|
|
|
"parentId": "page1",
|
|
|
|
"point": Array [
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
],
|
|
|
|
"points": Array [
|
|
|
|
Array [
|
|
|
|
100,
|
|
|
|
100,
|
|
|
|
],
|
|
|
|
Array [
|
|
|
|
200,
|
|
|
|
200,
|
|
|
|
],
|
|
|
|
Array [
|
|
|
|
300,
|
|
|
|
300,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
"rotation": 0,
|
|
|
|
"style": Object {
|
|
|
|
"color": "Red",
|
|
|
|
"dash": "Dotted",
|
|
|
|
"isFilled": false,
|
|
|
|
"size": "Medium",
|
|
|
|
},
|
|
|
|
"type": "draw",
|
|
|
|
},
|
|
|
|
]
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`selection generates a rectangle shape: generated rectangle from code 1`] = `
|
|
|
|
Array [
|
|
|
|
Object {
|
|
|
|
"childIndex": 1,
|
|
|
|
"id": "test-rectangle",
|
|
|
|
"isAspectRatioLocked": false,
|
|
|
|
"isGenerated": true,
|
|
|
|
"isHidden": false,
|
|
|
|
"isLocked": false,
|
|
|
|
"name": "Test Rectangle",
|
|
|
|
"parentId": "page1",
|
|
|
|
"point": Array [
|
|
|
|
100,
|
|
|
|
100,
|
|
|
|
],
|
|
|
|
"radius": 2,
|
|
|
|
"rotation": 0,
|
|
|
|
"size": Array [
|
|
|
|
200,
|
|
|
|
200,
|
|
|
|
],
|
|
|
|
"style": Object {
|
|
|
|
"color": "Red",
|
|
|
|
"dash": "Dotted",
|
|
|
|
"isFilled": false,
|
|
|
|
"size": "Medium",
|
|
|
|
},
|
|
|
|
"type": "rectangle",
|
|
|
|
},
|
|
|
|
]
|
|
|
|
`;
|
|
|
|
|
2021-06-25 12:21:33 +00:00
|
|
|
exports[`selection generates a text shape: generated draw from code 1`] = `
|
|
|
|
Array [
|
|
|
|
Object {
|
|
|
|
"childIndex": 1,
|
|
|
|
"id": "test-text",
|
|
|
|
"isAspectRatioLocked": false,
|
|
|
|
"isGenerated": true,
|
|
|
|
"isHidden": false,
|
|
|
|
"isLocked": false,
|
|
|
|
"name": "Test text",
|
|
|
|
"parentId": "page1",
|
|
|
|
"point": Array [
|
|
|
|
100,
|
|
|
|
100,
|
|
|
|
],
|
|
|
|
"rotation": 0,
|
|
|
|
"scale": 1,
|
|
|
|
"style": Object {
|
|
|
|
"color": "Red",
|
|
|
|
"dash": "Dotted",
|
|
|
|
"isFilled": false,
|
|
|
|
"size": "Large",
|
|
|
|
},
|
|
|
|
"text": "Hello world!",
|
|
|
|
"type": "text",
|
|
|
|
},
|
|
|
|
]
|
|
|
|
`;
|
|
|
|
|
2021-06-25 12:09:53 +00:00
|
|
|
exports[`selection generates an arrow shape: generated draw from code 1`] = `
|
|
|
|
Array [
|
|
|
|
Object {
|
|
|
|
"bend": 0,
|
|
|
|
"childIndex": 1,
|
|
|
|
"decorations": Object {
|
|
|
|
"end": "Arrow",
|
|
|
|
"middle": null,
|
|
|
|
"start": null,
|
|
|
|
},
|
|
|
|
"handles": Object {
|
|
|
|
"bend": Object {
|
|
|
|
"id": "bend",
|
|
|
|
"index": 2,
|
|
|
|
"point": Array [
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
"end": Object {
|
|
|
|
"id": "end",
|
|
|
|
"index": 1,
|
|
|
|
"point": Array [
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
"start": Object {
|
|
|
|
"id": "start",
|
|
|
|
"index": 0,
|
|
|
|
"point": Array [
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"id": "test-draw",
|
|
|
|
"isAspectRatioLocked": false,
|
|
|
|
"isGenerated": true,
|
|
|
|
"isHidden": false,
|
|
|
|
"isLocked": false,
|
|
|
|
"name": "Test draw",
|
|
|
|
"parentId": "page1",
|
|
|
|
"point": Array [
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
],
|
|
|
|
"points": Array [
|
|
|
|
Array [
|
|
|
|
100,
|
|
|
|
100,
|
|
|
|
],
|
|
|
|
Array [
|
|
|
|
200,
|
|
|
|
200,
|
|
|
|
],
|
|
|
|
Array [
|
|
|
|
300,
|
|
|
|
300,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
"rotation": 0,
|
|
|
|
"style": Object {
|
|
|
|
"color": "Red",
|
|
|
|
"dash": "Dotted",
|
|
|
|
"isFilled": false,
|
|
|
|
"size": "Medium",
|
|
|
|
},
|
|
|
|
"type": "arrow",
|
|
|
|
},
|
|
|
|
]
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`selection generates an ellipse shape: generated ellipse from code 1`] = `
|
|
|
|
Array [
|
|
|
|
Object {
|
|
|
|
"childIndex": 1,
|
|
|
|
"id": "test-ellipse",
|
|
|
|
"isAspectRatioLocked": false,
|
|
|
|
"isGenerated": true,
|
|
|
|
"isHidden": false,
|
|
|
|
"isLocked": false,
|
|
|
|
"name": "Test ellipse",
|
|
|
|
"parentId": "page1",
|
|
|
|
"point": Array [
|
|
|
|
100,
|
|
|
|
100,
|
|
|
|
],
|
|
|
|
"radiusX": 100,
|
|
|
|
"radiusY": 200,
|
|
|
|
"rotation": 0,
|
|
|
|
"style": Object {
|
|
|
|
"color": "Red",
|
|
|
|
"dash": "Dotted",
|
|
|
|
"isFilled": false,
|
|
|
|
"size": "Medium",
|
|
|
|
},
|
|
|
|
"type": "ellipse",
|
|
|
|
},
|
|
|
|
]
|
|
|
|
`;
|
|
|
|
|
2021-06-25 11:01:22 +00:00
|
|
|
exports[`selection generates shapes: generated rectangle from code 1`] = `
|
|
|
|
Array [
|
|
|
|
Object {
|
|
|
|
"childIndex": 1,
|
|
|
|
"id": "test-rectangle",
|
|
|
|
"isAspectRatioLocked": false,
|
|
|
|
"isGenerated": true,
|
|
|
|
"isHidden": false,
|
|
|
|
"isLocked": false,
|
|
|
|
"name": "Test Rectangle",
|
|
|
|
"parentId": "page1",
|
|
|
|
"point": Array [
|
|
|
|
100,
|
|
|
|
100,
|
|
|
|
],
|
|
|
|
"radius": 2,
|
|
|
|
"rotation": 0,
|
|
|
|
"size": Array [
|
|
|
|
200,
|
|
|
|
200,
|
|
|
|
],
|
|
|
|
"style": Object {
|
|
|
|
"color": "Red",
|
|
|
|
"dash": "Dotted",
|
|
|
|
"isFilled": false,
|
|
|
|
"size": "Medium",
|
|
|
|
},
|
|
|
|
"type": "rectangle",
|
|
|
|
},
|
|
|
|
]
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`selection updates a code control: data in state after changing control 1`] = `
|
|
|
|
Object {
|
|
|
|
"test-number-control": Object {
|
|
|
|
"id": "test-number-control",
|
|
|
|
"label": "x",
|
|
|
|
"step": 1,
|
|
|
|
"type": "number",
|
|
|
|
"value": 100,
|
|
|
|
},
|
|
|
|
"test-vector-control": Object {
|
|
|
|
"id": "test-vector-control",
|
|
|
|
"isNormalized": false,
|
|
|
|
"label": "size",
|
|
|
|
"type": "vector",
|
|
|
|
"value": Array [
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
`;
|
2021-06-25 12:21:33 +00:00
|
|
|
|
|
|
|
exports[`selection updates a code control: rectangle in state after changing code control 1`] = `
|
|
|
|
Object {
|
|
|
|
"childIndex": 1,
|
|
|
|
"id": "test-rectangle",
|
|
|
|
"isAspectRatioLocked": false,
|
|
|
|
"isGenerated": true,
|
|
|
|
"isHidden": false,
|
|
|
|
"isLocked": false,
|
|
|
|
"name": "Test Rectangle",
|
|
|
|
"parentId": "page1",
|
|
|
|
"point": Array [
|
|
|
|
0,
|
|
|
|
100,
|
|
|
|
],
|
|
|
|
"radius": 2,
|
|
|
|
"rotation": 0,
|
|
|
|
"size": Array [
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
],
|
|
|
|
"style": Object {
|
|
|
|
"color": "Red",
|
|
|
|
"dash": "Dotted",
|
|
|
|
"isFilled": false,
|
|
|
|
"size": "Medium",
|
|
|
|
},
|
|
|
|
"type": "rectangle",
|
|
|
|
}
|
|
|
|
`;
|