Add a test to cover the newly discovered nil case
This commit is contained in:
parent
656f586ece
commit
5c17176f8d
|
@ -45,6 +45,20 @@
|
|||
(is (= (get-effect a :db) ;; test after
|
||||
{:1 {:2 :4}})))))
|
||||
|
||||
(deftest test-path-with-nil-db
|
||||
(let [db {:1 {:2 :target}}
|
||||
p (path [:1 :2])] ;; a two level path
|
||||
|
||||
(let [b4 (-> (context [] [] db)
|
||||
((:before p))) ;; before
|
||||
a (-> b4
|
||||
(assoc-effect :db nil) ;; <-- db becomes nil
|
||||
((:after p)))] ;; after
|
||||
|
||||
(is (= (get-coeffect b4 :db)) ;; test before
|
||||
:target)
|
||||
(is (= (get-effect a :db) ;; test after
|
||||
{:1 {:2 nil}})))))
|
||||
|
||||
(deftest test-db-handler-interceptor
|
||||
(let [event [:a :b]
|
||||
|
|
Loading…
Reference in New Issue