0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -05:00
penpot/frontend/tests/app/test_draft_conversion.cljs

28 lines
988 B
Text
Raw Normal View History

(ns app.test-draft-conversion
(:require
[app.common.data :as d]
[app.common.text :as txt]
[cljs.test :as t :include-macros true]
[cljs.pprint :refer [pprint]]))
(t/deftest test-basic-conversion-roundtrip
(let [text "qwqw 🠒"
content {:type "root",
:children
[{:type "paragraph-set",
:children
[{:key "cfjh",
:type "paragraph",
:children
[{:font-id "gfont-roboto",
:font-family "Roboto",
:font-variant-id "regular",
:font-weight "400",
:font-style "normal",
:text text}]}]}]}]
(cljs.pprint/pprint (txt/convert-to-draft content))
(cljs.pprint/pprint (txt/convert-from-draft (txt/convert-to-draft content)))
(t/is (= (txt/convert-from-draft (txt/convert-to-draft content))
content))))