Created
July 30, 2016 15:42
-
-
Save joshuaNjordan85/b11599f3cabffce372975b546034031b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftest test-routing | |
(checking (str "that when route-to is dispatched, the view" | |
"routed-to is added to the view-history and" | |
" that when route-back is dispatched, the view" | |
" routed to is the previous view in the view-" | |
"history") 100 | |
[routing-events (s/gen ::route-to-events)] | |
(reset-db!) | |
(run! dispatch-sync routing-events) | |
(let [without-last-route (pop routing-events) | |
view-history (get-in @re-frame.db/app-db [:wolo.db/view-history])] | |
(is (= (mapv second routing-events) view-history)) | |
(fn [] | |
(dispatch-sync [:event/route-back]) | |
(is (= (val (last without-last-route)) view-history)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment