You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

code.test.ts.snap 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`selection creates a code control: generated code controls from code 1`] = `
  3. Object {
  4. "test-number-control": Object {
  5. "id": "test-number-control",
  6. "label": "x",
  7. "step": 1,
  8. "type": "number",
  9. "value": 0,
  10. },
  11. }
  12. `;
  13. exports[`selection generates a draw shape: generated draw from code 1`] = `
  14. Array [
  15. Object {
  16. "childIndex": 1,
  17. "id": "test-draw",
  18. "isGenerated": true,
  19. "name": "Test draw",
  20. "parentId": "page1",
  21. "point": Array [
  22. 0,
  23. 0,
  24. ],
  25. "points": Array [
  26. Array [
  27. 100,
  28. 100,
  29. ],
  30. Array [
  31. 200,
  32. 200,
  33. ],
  34. Array [
  35. 300,
  36. 300,
  37. ],
  38. ],
  39. "rotation": 0,
  40. "style": Object {
  41. "color": "Red",
  42. "dash": "Dotted",
  43. "isFilled": false,
  44. "size": "Medium",
  45. },
  46. "type": "draw",
  47. },
  48. ]
  49. `;
  50. exports[`selection generates a rectangle shape: generated rectangle from code 1`] = `
  51. Array [
  52. Object {
  53. "childIndex": 1,
  54. "id": "test-rectangle",
  55. "isGenerated": true,
  56. "name": "Test Rectangle",
  57. "parentId": "page1",
  58. "point": Array [
  59. 100,
  60. 100,
  61. ],
  62. "radius": 2,
  63. "rotation": 0,
  64. "size": Array [
  65. 200,
  66. 200,
  67. ],
  68. "style": Object {
  69. "color": "Red",
  70. "dash": "Dotted",
  71. "isFilled": false,
  72. "size": "Medium",
  73. },
  74. "type": "rectangle",
  75. },
  76. ]
  77. `;
  78. exports[`selection generates a text shape: generated draw from code 1`] = `
  79. Array [
  80. Object {
  81. "childIndex": 1,
  82. "id": "test-text",
  83. "isGenerated": true,
  84. "name": "Test text",
  85. "parentId": "page1",
  86. "point": Array [
  87. 100,
  88. 100,
  89. ],
  90. "rotation": 0,
  91. "scale": 1,
  92. "style": Object {
  93. "color": "Red",
  94. "dash": "Dotted",
  95. "isFilled": false,
  96. "size": "Large",
  97. },
  98. "text": "Hello world!",
  99. "type": "text",
  100. },
  101. ]
  102. `;
  103. exports[`selection generates an arrow shape: generated draw from code 1`] = `
  104. Array [
  105. Object {
  106. "bend": 0,
  107. "childIndex": 1,
  108. "decorations": Object {
  109. "end": "Arrow",
  110. "middle": null,
  111. "start": null,
  112. },
  113. "handles": Object {
  114. "bend": Object {
  115. "id": "bend",
  116. "index": 2,
  117. "point": Array [
  118. 50,
  119. 50,
  120. ],
  121. },
  122. "end": Object {
  123. "id": "end",
  124. "index": 1,
  125. "point": Array [
  126. 100,
  127. 100,
  128. ],
  129. },
  130. "start": Object {
  131. "id": "start",
  132. "index": 0,
  133. "point": Array [
  134. 0,
  135. 0,
  136. ],
  137. },
  138. },
  139. "id": "test-draw",
  140. "isGenerated": true,
  141. "name": "Test draw",
  142. "parentId": "page1",
  143. "point": Array [
  144. 0,
  145. 0,
  146. ],
  147. "points": Array [
  148. Array [
  149. 100,
  150. 100,
  151. ],
  152. Array [
  153. 200,
  154. 200,
  155. ],
  156. Array [
  157. 300,
  158. 300,
  159. ],
  160. ],
  161. "rotation": 0,
  162. "style": Object {
  163. "color": "Red",
  164. "dash": "Dotted",
  165. "isFilled": false,
  166. "size": "Medium",
  167. },
  168. "type": "arrow",
  169. },
  170. ]
  171. `;
  172. exports[`selection generates an ellipse shape: generated ellipse from code 1`] = `
  173. Array [
  174. Object {
  175. "childIndex": 1,
  176. "id": "test-ellipse",
  177. "isGenerated": true,
  178. "name": "Test ellipse",
  179. "parentId": "page1",
  180. "point": Array [
  181. 100,
  182. 100,
  183. ],
  184. "radiusX": 100,
  185. "radiusY": 200,
  186. "rotation": 0,
  187. "style": Object {
  188. "color": "Red",
  189. "dash": "Dotted",
  190. "isFilled": false,
  191. "size": "Medium",
  192. },
  193. "type": "ellipse",
  194. },
  195. ]
  196. `;
  197. exports[`selection generates shapes: generated rectangle from code 1`] = `
  198. Array [
  199. Object {
  200. "childIndex": 1,
  201. "id": "test-rectangle",
  202. "isGenerated": true,
  203. "name": "Test Rectangle",
  204. "parentId": "page1",
  205. "point": Array [
  206. 100,
  207. 100,
  208. ],
  209. "radius": 2,
  210. "rotation": 0,
  211. "size": Array [
  212. 200,
  213. 200,
  214. ],
  215. "style": Object {
  216. "color": "Red",
  217. "dash": "Dotted",
  218. "isFilled": false,
  219. "size": "Medium",
  220. },
  221. "type": "rectangle",
  222. },
  223. ]
  224. `;
  225. exports[`selection updates a code control: data in state after changing control 1`] = `
  226. Object {
  227. "test-number-control": Object {
  228. "id": "test-number-control",
  229. "label": "x",
  230. "step": 1,
  231. "type": "number",
  232. "value": 100,
  233. },
  234. "test-vector-control": Object {
  235. "id": "test-vector-control",
  236. "isNormalized": false,
  237. "label": "size",
  238. "type": "vector",
  239. "value": Array [
  240. 0,
  241. 0,
  242. ],
  243. },
  244. }
  245. `;
  246. exports[`selection updates a code control: rectangle in state after changing code control 1`] = `
  247. Object {
  248. "childIndex": 1,
  249. "id": "test-rectangle",
  250. "isGenerated": true,
  251. "name": "Test Rectangle",
  252. "parentId": "page1",
  253. "point": Array [
  254. 0,
  255. 100,
  256. ],
  257. "radius": 2,
  258. "rotation": 0,
  259. "size": Array [
  260. 0,
  261. 0,
  262. ],
  263. "style": Object {
  264. "color": "Red",
  265. "dash": "Dotted",
  266. "isFilled": false,
  267. "size": "Medium",
  268. },
  269. "type": "rectangle",
  270. }
  271. `;