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

    (render {:color "blue"})

    ;; in all instances of prev-props, color was "pink"
    (validate-transition :props
                         {:color "purple"}                  ;; initial
                         {:color "pink"}                    ;; before
                         {:color "blue"}                    ;; after
                         @lifecycle-log)

    ;; state has not changed
    (validate-transition :state
                         initial-state                      ;; initial
                         initial-state                      ;; before
                         initial-state                      ;; after
                         @lifecycle-log)

    ;; Prop transition, view/render-component (with .forceUpdate)
    (reset! lifecycle-log {})
    (view/render-component this {:color "yellow"})
    (view/render-component this {:color "mink"})

    (validate-transition :props
                         nil                                ;; initial
                         {:color "yellow"}                  ;; before
                         {:color "mink"}                    ;; after
                         @lifecycle-log)

    ;; Two force-renders in a row

    (view/render-component this {:color "fox"})

    (validate-transition :props
                         nil                                ;; initial
                         {:color "mink"}                    ;; before
                         {:color "fox"}                     ;; after
                         @lifecycle-log)


    ;; Force-render followed by normal render

    (render {:color "bear"})

    (validate-transition :props
                         nil                                ;; initial
                         {:color "fox"}                     ;; before
                         {:color "bear"}                    ;; after
                         @lifecycle-log)

    ;; State transition
    (reset! lifecycle-log {})
    (view/set-state! this {:shiny? false})
    (view/update-state! this update :shiny? not)

    (validate-transition :state
                         nil                                ;; initial
                         {:shiny? false}                    ;; before
                         {:shiny? true}                     ;; after
                         @lifecycle-log)))

               :get-initial-state [_ _ _]
               :component-will-mount [initial-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-transitions
  (let [el (js/document.body.appendChild (doto (js/document.createElement "div")
                                           (.setAttribute "id" "apple")))
        render #(js/ReactDOM.render (apple %1 nil) el)
