Skip to content

Commit

Permalink
Merge tag '2.6.0-RC1' into develop
Browse files Browse the repository at this point in the history
   2.6.0-RC1
  • Loading branch information
awkay committed Jul 13, 2018
2 parents 82a83ea + b95a7b4 commit b0af8cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/cards/fulcro/democards/react16_cards.cljs
Expand Up @@ -29,7 +29,7 @@
;:componentWillMount (fn [] (js/console.log :will-mount :cp (prim/props this) :cs (prim/get-state this)))
;:UNSAFE_componentWillReceiveProps (fn [next-props] (js/console.log :will-rp :curr-props (prim/props this) :next-props next-props))
;:UNSAFE_componentWillUpdate (fn [next-props next-state] (js/console.log :will-update :cp (prim/props this) :np next-props :cs (prim/get-state this) :crs (prim/get-rendered-state this) :ns next-state))
:UNSAFE_componentWillMount (fn [] #_(js/console.log :will-mount :cp (prim/props this) :cs (prim/get-state this)))
;:UNSAFE_componentWillMount (fn [] #_(js/console.log :will-mount :cp (prim/props this) :cs (prim/get-state this)))
}
(dom/div
#_(js/console.log :pmeta (meta (prim/props this)))
Expand Down
24 changes: 8 additions & 16 deletions src/test/fulcro/client/primitives_spec.cljc
Expand Up @@ -3,7 +3,8 @@
[fulcro.client.primitives :as prim :refer [defui defsc]]
[fulcro.history :as hist]
#?(:cljs [fulcro.client.dom :as dom]
:clj [fulcro.client.dom-server :as dom])
:clj
[fulcro.client.dom-server :as dom])
[fulcro-css.css]
[clojure.spec.alpha :as s]
[clojure.core.async :as async]
Expand Down Expand Up @@ -1127,10 +1128,14 @@
(assertions
"Replaces the first symbol in a method/lambda form"
(#'prim/replace-and-validate-fn 'nm [] 0 '(fn [] ...)) => '(nm [] ...)
"Allows correct number of args"
(#'prim/replace-and-validate-fn 'nm ['this] 1 '(fn [x] ...)) => '(nm [this x] ...)
"Allows too many args"
(#'prim/replace-and-validate-fn 'nm ['this] 1 '(fn [x y z] ...)) => '(nm [this x y z] ...)
"Prepends the additional arguments to the front of the argument list"
(#'prim/replace-and-validate-fn 'nm ['that 'other-thing] 3 '(fn [x y z] ...)) => '(nm [that other-thing x y z] ...)
"Throws an exception if the arity is wrong"
(#'prim/replace-and-validate-fn 'nm [] 2 '(fn [p] ...))
"Throws an exception if there are too few arguments"
(#'prim/replace-and-validate-fn 'nm ['a] 2 '(fn [p] ...))
=throws=> (ExceptionInfo #"Invalid arity for nm")))
(component "build-css"
(assertions
Expand Down Expand Up @@ -1375,19 +1380,6 @@
(render [this]
(clojure.core/let [{:keys [db/id]} (fulcro.client.primitives/props this)]
(dom/div nil "Boo"))))
"checks method arity on css"
(prim/defsc* '(Person
[this {:keys [db/id]}]
{:query [:db/id]
:css (fn [a b] [])}
(dom/div nil "Boo")))
=throws=> (ExceptionInfo #"Invalid arity for css")
"checks method arity on css-include"
(prim/defsc* '(Person
[this {:keys [db/id]}]
{:css-include (fn [a b] [])}
(dom/div nil "Boo")))
=throws=> (ExceptionInfo #"Invalid arity for css-include")
"allows method bodies"
(prim/defsc* '(Person
[this {:keys [db/id]}]
Expand Down

0 comments on commit b0af8cc

Please sign in to comment.