1
0
Fork 0
mirror of https://github.com/heyarne/airsonic-ui.git synced 2026-05-06 18:33:38 +02:00

Remember login credentials

This commit is contained in:
Arne Schlüter 2018-05-30 18:38:40 +02:00
commit b480676cef
5 changed files with 51 additions and 17 deletions

View file

@ -14,7 +14,7 @@
(is (str/starts-with? (:uri request) server))
(is (str/includes? (:uri request) "/ping")))
(testing "saves the given server location"
(is (= server (get-in fx [:db :server]))))
(is (= server (get-in fx [:db :credentials :server]))))
(testing "invokes correct success callback"
(is (= ::events/credentials-verified (first (:on-success request)))))))
(testing "On succesfull response"
@ -23,6 +23,7 @@
(testing "credentials are sent to the router for access rights"
(is (= credentials (:routes/set-credentials fx))))
(testing "credentials are saved in the global state"
(is (= credentials (get-in fx [:db :login]))))
(is (= credentials (-> (get-in fx [:db :credentials])
(select-keys [:u :p])))))
(testing "the login process is finalized"
(is (= [::events/logged-in] (:dispatch fx)))))))