Skip to content

Commit

Permalink
refactor(test): shuffle fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
thelissimus committed Jan 5, 2024
1 parent 248b9c1 commit e678cc7
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions test/challenge/frontend/core_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@
:address #(.getByPlaceholderText % "Address")
:insurance #(.getByPlaceholderText % "Insurance")})

;;; Fixtures
(defn create-app-element [tests]
(.appendChild (.-body js/document)
(doto (.createElement js/document "div")
(.setAttribute "id" "app")
(.setAttribute "style" "display:none;")))
(setup-router)
(tests))

(use-fixtures :once create-app-element)
(use-fixtures :each (fn [test] (test) (rtl/cleanup)))

;;; Tests
(deftest init
(testing "Renders correctly"
Expand Down Expand Up @@ -137,14 +149,3 @@
:address ""
:insurance ""}}])
(with-render [show] (fn [_] (is (->> thead-queries vals (map #(% screen)) (every? some?))))))))

(defn create-app-element [tests]
(.appendChild (.-body js/document)
(doto (.createElement js/document "div")
(.setAttribute "id" "app")
(.setAttribute "style" "display:none;")))
(setup-router)
(tests))

(use-fixtures :once create-app-element)
(use-fixtures :each (fn [test] (test) (rtl/cleanup)))

0 comments on commit e678cc7

Please sign in to comment.