       {:msg "Text does not match" :expected text :actual component}
       )
     )
-  )
-
-(defn component-name [component]
-  (.-name component)                    ; This isn't standard JS, but
-                                        ; works enough places, for now
   )
 
 (defn sub-component [sub-component cursor]

        (let [child-count (count children)]
          (if (not= test-count child-count)
            {:msg "Wrong number of child elements"
             :expected test-count :actual child-count}
            (if-let [failures
                     (seq (filter (fn [result] (not= true result))
                                  (map (fn [pred child] (pred child))

          )
        )
      )
    )
  )

(defn multiple-components? [component]
  (= (type component) js/Array))

(declare display-children)

(defn display-child
  ([component]
     (cond
      (not (nil? (.. component -props)))
      {
       :tag (tag-name component)
       :children (display-children (.. component -props -children))
       }
      (fn? component) {:sub-component (component-name component)}
      (string? component) {:text component}
      (satisfies? IDeref component) {:cursor @component}
      :else {:unknown "unknown"}
      )
     )
  )

(defn display-children [children]
  (if (multiple-components? children)
    (map #(display-child %) children)
    (display-child children)
    )
  )

