mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-06 18:33:38 +02:00
Add tests for helper functions
This commit is contained in:
parent
cd06abff97
commit
84450479ae
3 changed files with 26 additions and 12 deletions
8
test/cljs/airsonic_ui/test_helpers.cljs
Normal file
8
test/cljs/airsonic_ui/test_helpers.cljs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
(ns airsonic-ui.test-helpers)
|
||||
|
||||
(defn dispatches?
|
||||
"Helper to see whether an event is dispatched in a coeffect; `ev` can either
|
||||
be a whole vector or a keyword which is interpreted as the event name."
|
||||
[cofx ev]
|
||||
(let [all-events (conj (get cofx :dispatch-n []) (:dispatch cofx))]
|
||||
(some #(= ev (if (vector? ev) % (first %))) all-events)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue