mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-07 02:33:39 +02:00
Implement set-current-track
This commit is contained in:
parent
b529b2fabe
commit
4043eb48e7
6 changed files with 67 additions and 32 deletions
|
|
@ -2,27 +2,11 @@
|
|||
(:require [cljs.test :refer [deftest testing is]]
|
||||
[airsonic-ui.audio.playlist :as playlist]
|
||||
[airsonic-ui.fixtures :as fixtures]
|
||||
[airsonic-ui.test-helpers :as helpers]
|
||||
[debux.cs.core :refer-macros [dbg]]))
|
||||
[airsonic-ui.test-helpers :refer [song song-queue]]
|
||||
#_[debux.cs.core :refer-macros [dbg]]))
|
||||
|
||||
(enable-console-print!)
|
||||
|
||||
(defn- song []
|
||||
(hash-map :id (rand-int 9999)
|
||||
:coverArt (rand-int 9999)
|
||||
:year (+ 1900 (rand-int 118))
|
||||
:artist (helpers/rand-str)
|
||||
:artistId (rand-int 100000)
|
||||
:title (helpers/rand-str)
|
||||
:album (helpers/rand-str)))
|
||||
|
||||
(defn- song-queue
|
||||
"Generates a seq of n different songs"
|
||||
[n]
|
||||
(let [r-int (atom 0)]
|
||||
(with-redefs [rand-int #(mod (swap! r-int inc) %1)]
|
||||
(repeatedly n song))))
|
||||
|
||||
(def fixture
|
||||
{:audio {:current-song fixtures/song
|
||||
:playlist (song-queue 20)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue