301 lines
5.4 KiB
Text
301 lines
5.4 KiB
Text
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
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,
|
|
},
|
|
}
|
|
`;
|
|
|
|
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",
|
|
},
|
|
]
|
|
`;
|
|
|
|
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",
|
|
},
|
|
]
|
|
`;
|
|
|
|
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",
|
|
},
|
|
]
|
|
`;
|
|
|
|
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,
|
|
],
|
|
},
|
|
}
|
|
`;
|
|
|
|
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",
|
|
}
|
|
`;
|