                                :background    "red"
                                :border-radius 100}}])
 
-(deftest state
-  (let [el (js/document.body.appendChild (doto (js/document.createElement "div")
-                                           (.setAttribute "id" "apple")))
+(def append-el #(js/document.body.appendChild (js/document.createElement "div")))
+
+(deftest basic
+  (let [el (append-el)
         render #(js/ReactDOM.render (apple %1 %2) el)
         c (render init-props init-child)]
 


               :get-initial-state [_ _ _]
               :component-will-mount [initial-val _ _]
               ;:component-will-receive-props [before-val _ _]
               :should-component-update [before-val _ after-val]
               :component-will-update [before-val _ after-val]
               :render [after-val _ _]
               :component-did-update [after-val before-val _]))))

(deftest lifecycle
  (let [el (js/document.body.appendChild (doto (js/document.createElement "div")
                                           (.setAttribute "id" "apple")))
        render #(js/ReactDOM.render (apple %1 nil) el)

        "State has changed")
    (is (= 2 @render-count)
        "Component was rendered")
    (is (= "red" (:color (view/props c)))
        "Read props")

