This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-28
Channels
- # beginners (79)
- # boot (24)
- # cider (5)
- # clara (5)
- # cljs-experience (5)
- # clojure (126)
- # clojure-greece (5)
- # clojure-italy (3)
- # clojure-losangeles (1)
- # clojure-russia (1)
- # clojure-spec (21)
- # clojure-uk (31)
- # clojurescript (151)
- # community-development (20)
- # cursive (25)
- # datomic (24)
- # flambo (1)
- # fulcro (312)
- # graphql (10)
- # hoplon (20)
- # juxt (2)
- # keechma (6)
- # leiningen (7)
- # luminus (4)
- # om (4)
- # onyx (7)
- # parinfer (24)
- # protorepl (1)
- # re-frame (7)
- # reagent (13)
- # shadow-cljs (19)
- # spacemacs (14)
- # specter (14)
- # uncomplicate (22)
- # unrepl (1)
@flyboarder after playing around with some specs for things that use dom elements last night, i think it could also be cool to define a :hoplon/element
that has a generator for dom elements and goog.dom.isElement
as predicate
i made a bit of a start:
(spec/def :wheel.dom/element
(spec/spec
goog.dom/isElement
:gen
(constantly
(gen/fmap
apply
(gen/elements [h/div h/span h/p])))))
eventually it could do all sorts of things like building nested structures and including text and attributes
then you can use spec/exercise
to generate example DOM for testing application logic
a bunch of my tests started throwing #object[Error Error: Index out of bounds]
i wonder if it has to do with the newer cljs
Testing fine for me?
yeah in my own project
just started failing previously passing tests in master
so i have to assume its the new snapshot coming in
Cljs snapshot?
as in, new version of hoplon, so new version of cljs
it's alright, i'll keep poking around
; we need to handle dynamic length cells
(let [c (j/cell ["1" "2" "3"])
el (h/div
(h/for-tpl [n c]
(h/div n)))]
(is (= ["1" "2" "3"]
(find-text el)))
(reset! c ["1" "2"])
(is (= ["1" "2"]
(find-text el))))))
ERROR in (??for-tpl) ([email protected]:5422:41)
Uncaught exception, not in assertion.
expected: nil
actual: #object[Error Error: Index out of bounds]