                        :key)]
     result
     (do
-      ; we don't use .error because PhantomJS somehow stops on it on running testing
+      ; we don't use .error because PhantomJS somehow stops on it on running tests
       (.log js/console "ERROR: Could not determine visibility for token" (pr-str (::routing/token model)) ". Will use some default visibility.")
       (-> -visibility-spec first :key))))
 


;;;;;;;;;;;;;;;;;;;;;;;; View model
(def -visibility-spec
  ; multiple tokens are supported mostly for :all case:
  ; on navigating to base url the token is "", but on clicking the link the token becomes "/"
  [{:key :all :title "All" :href "#/" :tokens #{"" "/"}}
   {:key :active :title "Active" :href "#/active" :tokens #{"/active"}}
   {:key :completed :title "Completed" :href "#/completed" :tokens #{"/completed"}}])

   [:ul.filters
    (for [{:keys [key title href]} -visibility-spec]
      ^{:key key}
      [:li [:a
            {:href  href
             :class (if (= visibility key) "selected")}
            title]])]

   (if has-completed-todos?
     [:button.clear-completed {:on-click #(dispatch :on-clear-completed)} "Clear completed"])])
