0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00
penpot/common/test/common_tests/text_test.cljc

34 lines
1.2 KiB
Text
Raw Permalink Normal View History

;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns common-tests.text-test
(:require
[app.common.data :as d]
[app.common.text :as txt]
2024-01-05 07:49:57 -05:00
[clojure.pprint :refer [pprint]]
[clojure.test :as t :include-macros true]))
(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))))