merge-requests/154/head
Bat 2018-03-31 14:29:20 +01:00
rodzic 6b8dc1b53c
commit 80af4268e3
1 zmienionych plików z 19 dodań i 8 usunięć

Wyświetl plik

@ -204,22 +204,33 @@ describe('store/queue', () => {
expectedActions: []
}, done)
})
it('previous when at beginning does nothing', (done) => {
it('previous when at beginning', (done) => {
testAction({
action: store.actions.previous,
params: {state: {currentIndex: 0}},
expectedActions: []
}, done)
})
it('previous', (done) => {
testAction({
action: store.actions.previous,
params: {state: {currentIndex: 1}},
expectedActions: [
{ type: 'currentIndex', payload: 0 }
]
}, done)
})
it('previous after less than 3 seconds of playback', (done) => {
testAction({
action: store.actions.previous,
params: {state: {currentIndex: 1}, rootState: {player: {currentTime: 1}}},
expectedActions: [
{ type: 'currentIndex', payload: 0 }
]
}, done)
})
it('previous after more than 3 seconds of playback', (done) => {
testAction({
action: store.actions.previous,
params: {state: {currentIndex: 1}, rootState: {player: {currentTime: 3}}},
expectedActions: [
{ type: 'currentIndex', payload: 1 }
]
}, done)
})
it('next on last track when looping on queue', (done) => {
testAction({
action: store.actions.next,