                                        (dom/a #js {:className (if (= current-filter :failed) "selected" "")
                                                    :onClick   #(om/transact! this '[(filter-failed)])}
                                               "Failed"))
-                              (dom/ul #js {:className "test-list"} (mapv (comp test-namespace
-                                                                               #(assoc %
-                                                                                       :report/filter current-filter
-                                                                                       :toggle-folded! (make-toggle-fn (:name %))
-                                                                                       :folded? (contains? folded-namespaces (:name %))))
-                                                                         (:namespaces test-report-data)))
+                              (dom/ul #js {:className "test-list"}
+                                      (mapv (comp test-namespace
+                                                  #(assoc % :report/filter current-filter))
+                                            (:namespaces test-report-data)))
+                              ;TODO: move to defui test-count
                               (let [rollup-stats (reduce (fn [acc item]
                                                            (let [counts [(:passed item) (:failed item) (:error item)
                                                                          (+ (:passed item) (:failed item) (:error item))]]


(defui TestReport
       static om/IQuery
       (query [this] [:top :report/filter :folded/namespaces])
       Object
       (render [this]
               (let [props (om/props this)
                     test-report-data (-> props :top)
                     current-filter (-> props :report/filter)
                     folded-namespaces (-> props :folded/namespaces)
                     make-toggle-fn (fn [n] #(om/transact! this `[(~'toggle-folded {:ns-name ~n})]))]
                 (dom/section #js {:className "test-report"}
                              (dom/div #js {:name "filters" :className "filter-controls"}
                                       (dom/label #js {:htmlFor "filters"} "Filter: ")
                                       (dom/a #js {:className (if (= current-filter :all) "selected" "")

(defmethod om-write 'filter-all [{:keys [state]} _ _] (swap! state assoc :report/filter :all))
(defmethod om-write 'filter-failed [{:keys [state]} _ _] (swap! state assoc :report/filter :failed))
(defmethod om-write 'filter-manual [{:keys [state]} _ _] (swap! state assoc :report/filter :manual))

(def test-parser (om/parser {:read om-read :mutate om-write}))

