restore.test.ts.snap 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
  2. exports[`restoreElements > should restore arrow element correctly 1`] = `
  3. {
  4. "angle": 0,
  5. "backgroundColor": "transparent",
  6. "boundElements": [],
  7. "endArrowhead": null,
  8. "endBinding": null,
  9. "fillStyle": "hachure",
  10. "frameId": null,
  11. "groupIds": [],
  12. "height": 100,
  13. "id": "id-arrow01",
  14. "isDeleted": false,
  15. "lastCommittedPoint": null,
  16. "link": null,
  17. "locked": false,
  18. "opacity": 100,
  19. "points": [
  20. [
  21. 0,
  22. 0,
  23. ],
  24. [
  25. 100,
  26. 100,
  27. ],
  28. ],
  29. "roughness": 1,
  30. "roundness": {
  31. "type": 2,
  32. },
  33. "seed": Any<Number>,
  34. "startArrowhead": null,
  35. "startBinding": null,
  36. "strokeColor": "#1e1e1e",
  37. "strokeStyle": "solid",
  38. "strokeWidth": 1,
  39. "type": "arrow",
  40. "updated": 1,
  41. "version": 1,
  42. "versionNonce": 0,
  43. "width": 100,
  44. "x": 0,
  45. "y": 0,
  46. }
  47. `;
  48. exports[`restoreElements > should restore correctly with rectangle, ellipse and diamond elements 1`] = `
  49. {
  50. "angle": 0,
  51. "backgroundColor": "blue",
  52. "boundElements": [],
  53. "fillStyle": "cross-hatch",
  54. "frameId": null,
  55. "groupIds": [
  56. "1",
  57. "2",
  58. "3",
  59. ],
  60. "height": 200,
  61. "id": "1",
  62. "isDeleted": false,
  63. "link": null,
  64. "locked": false,
  65. "opacity": 10,
  66. "roughness": 2,
  67. "roundness": {
  68. "type": 3,
  69. },
  70. "seed": Any<Number>,
  71. "strokeColor": "red",
  72. "strokeStyle": "dashed",
  73. "strokeWidth": 2,
  74. "type": "rectangle",
  75. "updated": 1,
  76. "version": 1,
  77. "versionNonce": 0,
  78. "width": 100,
  79. "x": 10,
  80. "y": 20,
  81. }
  82. `;
  83. exports[`restoreElements > should restore correctly with rectangle, ellipse and diamond elements 2`] = `
  84. {
  85. "angle": 0,
  86. "backgroundColor": "blue",
  87. "boundElements": [],
  88. "fillStyle": "cross-hatch",
  89. "frameId": null,
  90. "groupIds": [
  91. "1",
  92. "2",
  93. "3",
  94. ],
  95. "height": 200,
  96. "id": "2",
  97. "isDeleted": false,
  98. "link": null,
  99. "locked": false,
  100. "opacity": 10,
  101. "roughness": 2,
  102. "roundness": {
  103. "type": 3,
  104. },
  105. "seed": Any<Number>,
  106. "strokeColor": "red",
  107. "strokeStyle": "dashed",
  108. "strokeWidth": 2,
  109. "type": "ellipse",
  110. "updated": 1,
  111. "version": 1,
  112. "versionNonce": 0,
  113. "width": 100,
  114. "x": 10,
  115. "y": 20,
  116. }
  117. `;
  118. exports[`restoreElements > should restore correctly with rectangle, ellipse and diamond elements 3`] = `
  119. {
  120. "angle": 0,
  121. "backgroundColor": "blue",
  122. "boundElements": [],
  123. "fillStyle": "cross-hatch",
  124. "frameId": null,
  125. "groupIds": [
  126. "1",
  127. "2",
  128. "3",
  129. ],
  130. "height": 200,
  131. "id": "3",
  132. "isDeleted": false,
  133. "link": null,
  134. "locked": false,
  135. "opacity": 10,
  136. "roughness": 2,
  137. "roundness": {
  138. "type": 3,
  139. },
  140. "seed": Any<Number>,
  141. "strokeColor": "red",
  142. "strokeStyle": "dashed",
  143. "strokeWidth": 2,
  144. "type": "diamond",
  145. "updated": 1,
  146. "version": 1,
  147. "versionNonce": 0,
  148. "width": 100,
  149. "x": 10,
  150. "y": 20,
  151. }
  152. `;
  153. exports[`restoreElements > should restore freedraw element correctly 1`] = `
  154. {
  155. "angle": 0,
  156. "backgroundColor": "transparent",
  157. "boundElements": [],
  158. "fillStyle": "hachure",
  159. "frameId": null,
  160. "groupIds": [],
  161. "height": 0,
  162. "id": "id-freedraw01",
  163. "isDeleted": false,
  164. "lastCommittedPoint": null,
  165. "link": null,
  166. "locked": false,
  167. "opacity": 100,
  168. "points": [],
  169. "pressures": [],
  170. "roughness": 1,
  171. "roundness": {
  172. "type": 3,
  173. },
  174. "seed": Any<Number>,
  175. "simulatePressure": true,
  176. "strokeColor": "#1e1e1e",
  177. "strokeStyle": "solid",
  178. "strokeWidth": 1,
  179. "type": "freedraw",
  180. "updated": 1,
  181. "version": 1,
  182. "versionNonce": 0,
  183. "width": 0,
  184. "x": 0,
  185. "y": 0,
  186. }
  187. `;
  188. exports[`restoreElements > should restore line and draw elements correctly 1`] = `
  189. {
  190. "angle": 0,
  191. "backgroundColor": "transparent",
  192. "boundElements": [],
  193. "endArrowhead": null,
  194. "endBinding": null,
  195. "fillStyle": "hachure",
  196. "frameId": null,
  197. "groupIds": [],
  198. "height": 100,
  199. "id": "id-line01",
  200. "isDeleted": false,
  201. "lastCommittedPoint": null,
  202. "link": null,
  203. "locked": false,
  204. "opacity": 100,
  205. "points": [
  206. [
  207. 0,
  208. 0,
  209. ],
  210. [
  211. 100,
  212. 100,
  213. ],
  214. ],
  215. "roughness": 1,
  216. "roundness": {
  217. "type": 2,
  218. },
  219. "seed": Any<Number>,
  220. "startArrowhead": null,
  221. "startBinding": null,
  222. "strokeColor": "#1e1e1e",
  223. "strokeStyle": "solid",
  224. "strokeWidth": 1,
  225. "type": "line",
  226. "updated": 1,
  227. "version": 1,
  228. "versionNonce": 0,
  229. "width": 100,
  230. "x": 0,
  231. "y": 0,
  232. }
  233. `;
  234. exports[`restoreElements > should restore line and draw elements correctly 2`] = `
  235. {
  236. "angle": 0,
  237. "backgroundColor": "transparent",
  238. "boundElements": [],
  239. "endArrowhead": null,
  240. "endBinding": null,
  241. "fillStyle": "hachure",
  242. "frameId": null,
  243. "groupIds": [],
  244. "height": 100,
  245. "id": "id-draw01",
  246. "isDeleted": false,
  247. "lastCommittedPoint": null,
  248. "link": null,
  249. "locked": false,
  250. "opacity": 100,
  251. "points": [
  252. [
  253. 0,
  254. 0,
  255. ],
  256. [
  257. 100,
  258. 100,
  259. ],
  260. ],
  261. "roughness": 1,
  262. "roundness": {
  263. "type": 2,
  264. },
  265. "seed": Any<Number>,
  266. "startArrowhead": null,
  267. "startBinding": null,
  268. "strokeColor": "#1e1e1e",
  269. "strokeStyle": "solid",
  270. "strokeWidth": 1,
  271. "type": "line",
  272. "updated": 1,
  273. "version": 1,
  274. "versionNonce": 0,
  275. "width": 100,
  276. "x": 0,
  277. "y": 0,
  278. }
  279. `;
  280. exports[`restoreElements > should restore text element correctly passing value for each attribute 1`] = `
  281. {
  282. "angle": 0,
  283. "backgroundColor": "transparent",
  284. "baseline": 0,
  285. "boundElements": [],
  286. "containerId": null,
  287. "fillStyle": "hachure",
  288. "fontFamily": 1,
  289. "fontSize": 14,
  290. "frameId": null,
  291. "groupIds": [],
  292. "height": 100,
  293. "id": "id-text01",
  294. "isDeleted": false,
  295. "lineHeight": 1.25,
  296. "link": null,
  297. "locked": false,
  298. "opacity": 100,
  299. "originalText": "text",
  300. "roughness": 1,
  301. "roundness": {
  302. "type": 3,
  303. },
  304. "seed": Any<Number>,
  305. "strokeColor": "#1e1e1e",
  306. "strokeStyle": "solid",
  307. "strokeWidth": 1,
  308. "text": "text",
  309. "textAlign": "center",
  310. "type": "text",
  311. "updated": 1,
  312. "version": 1,
  313. "versionNonce": 0,
  314. "verticalAlign": "middle",
  315. "width": 100,
  316. "x": -20,
  317. "y": -8.75,
  318. }
  319. `;
  320. exports[`restoreElements > should restore text element correctly with unknown font family, null text and undefined alignment 1`] = `
  321. {
  322. "angle": 0,
  323. "backgroundColor": "transparent",
  324. "baseline": 0,
  325. "boundElements": [],
  326. "containerId": null,
  327. "fillStyle": "hachure",
  328. "fontFamily": 1,
  329. "fontSize": 10,
  330. "frameId": null,
  331. "groupIds": [],
  332. "height": 100,
  333. "id": "id-text01",
  334. "isDeleted": false,
  335. "lineHeight": 1.25,
  336. "link": null,
  337. "locked": false,
  338. "opacity": 100,
  339. "originalText": "test",
  340. "roughness": 1,
  341. "roundness": {
  342. "type": 3,
  343. },
  344. "seed": Any<Number>,
  345. "strokeColor": "#1e1e1e",
  346. "strokeStyle": "solid",
  347. "strokeWidth": 1,
  348. "text": "",
  349. "textAlign": "left",
  350. "type": "text",
  351. "updated": 1,
  352. "version": 1,
  353. "versionNonce": 0,
  354. "verticalAlign": "top",
  355. "width": 100,
  356. "x": 0,
  357. "y": 0,
  358. }
  359. `;