Remove test divs from dom after error

This commit is contained in:
Juho Teperi 2017-10-13 19:21:44 +03:00
parent 3fd0f1b1d8
commit 7d074b55ed

View File

@ -34,11 +34,13 @@
(defn with-mounted-component [comp f]
(when isClient
(let [div (add-test-div "_testreagent")]
(try
(let [c (r/render comp div)]
(f c div)
(f c div))
(finally
(r/unmount-component-at-node div)
(r/flush)
(.removeChild (.-body js/document) div)))))
(.removeChild (.-body js/document) div))))))
(defn found-in [re div]
(let [res (.-innerHTML div)]