mirror of
https://github.com/penpot/penpot.git
synced 2025-01-27 00:49:28 -05:00
548664f6ce
Make common as first-class module.
27 lines
995 B
Clojure
27 lines
995 B
Clojure
(ns app.common.text-test
|
|
(:require
|
|
[app.common.data :as d]
|
|
[app.common.text :as txt]
|
|
[clojure.test :as t :include-macros true]
|
|
[clojure.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))))
|
|
|