|
1 | 1 | (ns ^{:ornament/prefix "ot__"} |
2 | 2 | lambdaisland.ornament-test |
3 | | - (:require [lambdaisland.ornament :as o] |
4 | | - [clojure.test :refer [deftest testing is are use-fixtures run-tests join-fixtures]] |
5 | | - #?(:clj [lambdaisland.hiccup :as hiccup] |
6 | | - :cljs [lambdaisland.thicc :as thicc])) |
| 3 | + (:require |
| 4 | + [lambdaisland.ornament :as o] |
| 5 | + [clojure.string :as str] |
| 6 | + [clojure.test :refer [deftest testing is are use-fixtures run-tests join-fixtures]] |
| 7 | + #?(:clj [lambdaisland.hiccup :as hiccup] |
| 8 | + :cljs [lambdaisland.thicc :as thicc])) |
7 | 9 | #?(:cljs |
8 | 10 | (:require-macros lambdaisland.ornament-test))) |
9 | 11 |
|
|
273 | 275 | ;; conditionals. |
274 | 276 | ;; FIXME: write this in a more robust way, maintaining this is becoming a PITA |
275 | 277 | [attrs-in-fragment "hello"] |
276 | | - #?(:clj "<div lang=\"nl\" class=\"ot__attrs_in_fragment\">hello</div>" |
277 | | - :cljs "<div class=\"ot__attrs_in_fragment\" lang=\"nl\">hello</div>") |
| 278 | + "<div lang=\"nl\" class=\"ot__attrs_in_fragment\">hello</div>" |
278 | 279 |
|
279 | 280 | [attrs-in-fragment-props |
280 | 281 | {:person "Arne" |
281 | 282 | ::o/attrs {:lang "en" :title "greeting"}}] |
282 | | - #?(:clj "<div lang=\"en\" title=\"greeting\" class=\"ot__attrs_in_fragment_props\">hello, Arne</div>" |
283 | | - :cljs "<div title=\"greeting\" class=\"ot__attrs_in_fragment_props\" lang=\"en\">hello, Arne</div>") |
| 283 | + "<div lang=\"en\" title=\"greeting\" class=\"ot__attrs_in_fragment_props\">hello, Arne</div>" |
284 | 284 |
|
285 | 285 | [attrs-in-fragment-props {:person "Jake"}] |
286 | | - #?(:clj "<div lang=\"nl\" class=\"ot__attrs_in_fragment_props\">hello, Jake</div>" |
287 | | - :cljs "<div class=\"ot__attrs_in_fragment_props\" lang=\"nl\">hello, Jake</div>") |
| 286 | + "<div lang=\"nl\" class=\"ot__attrs_in_fragment_props\">hello, Jake</div>" |
288 | 287 |
|
289 | 288 | [attrs-in-fragment-styled {:person "Finn"}] |
290 | 289 | "<div class=\"ot__attrs_in_fragment_styled extra-class\" style=\"color: blue;\">hello, Finn</div>" |
|
460 | 459 |
|
461 | 460 | (deftest docstring-test |
462 | 461 | (is (= "A documented component" (:doc (meta #'with-doc)))) |
463 | | - (is (= "A documented component" (:doc (meta #'with-doc2)))) |
464 | | - (is (= "A documented component" (:doc (meta #'with-doc3)))) |
| 462 | + (is (str/starts-with? (:doc (meta #'with-doc2)) "A documented component")) |
| 463 | + (is (str/starts-with? (:doc (meta #'with-doc3)) "A documented component")) |
465 | 464 |
|
466 | | - (is (= '([] [& children] [attrs & children]) |
467 | | - (:arglists (meta #'combined)))) |
| 465 | + #?(:clj |
| 466 | + (is (= '([] [& children] [attrs & children]) |
| 467 | + (:arglists (meta #'combined))))) |
468 | 468 |
|
469 | | - (is (= '([{:keys [date time]}]) |
470 | | - (:arglists (meta #'timed))))) |
| 469 | + #?(:clj |
| 470 | + (is (= '([{:keys [date time]}]) |
| 471 | + (:arglists (meta #'timed)))))) |
471 | 472 |
|
472 | 473 | (comment |
473 | 474 | (require 'kaocha.repl) |
|
0 commit comments