1
0
Fork 0
mirror of https://github.com/heyarne/airsonic-ui.git synced 2026-05-06 18:33:38 +02:00
airsonic-ui/test/cljs/airsonic_ui/routes_test.cljs
Arne Schlüter cd06abff97 Restructure app init; fixes #5 and #11
Squashed commit of the following:

commit d4242bf1a390994606b7bd6e630c55338a14aad4
Author: Arne Schlüter <arne@schlueter.is>
Date:   Mon Jul 9 21:12:44 2018 +0200

    Add loading spinner, done with reworked app boot flow; fixes #5 and #11

commit e864ae4e578f96b86f3c0239b79f5224f0bb0020
Author: Arne Schlüter <arne@schlueter.is>
Date:   Mon Jul 9 19:43:02 2018 +0200

    Start restructuring app boot flow

commit a8cdbef80acde9f185a588ab86f8ea6964ebe8ab
Author: Arne Schlüter <arne@schlueter.is>
Date:   Mon Jul 9 14:03:43 2018 +0200

    Ignore rebel readline artifacts

commit 67eae3bc6aa2938ad6748c78b6259e532e66f865
Author: Arne Schlüter <arne@schlueter.is>
Date:   Mon Jul 9 14:03:11 2018 +0200

    Update shadow-cljs and run npm audit fix
2018-07-09 21:16:28 +02:00

14 lines
560 B
Clojure

(ns airsonic-ui.routes-test
(:require [airsonic-ui.routes :as routes]
[cljs.test :refer [deftest testing is]]))
(def fixtures
{:default [::route {:some :data} {:some-more true}]})
(deftest route-encoding
(testing "Should return a string with hash-compatible characters"
(let [encoded (routes/encode-route (:default fixtures))]
(is (string? encoded))
(is (re-matches #"^[^#?&=]+$" encoded))))
(testing "Should be bijective"
(is (= (:default fixtures) (routes/decode-route (routes/encode-route (:default fixtures)))))))