Tests
This commit is contained in:
parent
6b8dc1b53c
commit
80af4268e3
|
@ -204,22 +204,33 @@ describe('store/queue', () => {
|
||||||
expectedActions: []
|
expectedActions: []
|
||||||
}, done)
|
}, done)
|
||||||
})
|
})
|
||||||
it('previous when at beginning does nothing', (done) => {
|
it('previous when at beginning', (done) => {
|
||||||
testAction({
|
testAction({
|
||||||
action: store.actions.previous,
|
action: store.actions.previous,
|
||||||
params: {state: {currentIndex: 0}},
|
params: {state: {currentIndex: 0}},
|
||||||
expectedActions: []
|
|
||||||
}, done)
|
|
||||||
})
|
|
||||||
it('previous', (done) => {
|
|
||||||
testAction({
|
|
||||||
action: store.actions.previous,
|
|
||||||
params: {state: {currentIndex: 1}},
|
|
||||||
expectedActions: [
|
expectedActions: [
|
||||||
{ type: 'currentIndex', payload: 0 }
|
{ type: 'currentIndex', payload: 0 }
|
||||||
]
|
]
|
||||||
}, done)
|
}, 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) => {
|
it('next on last track when looping on queue', (done) => {
|
||||||
testAction({
|
testAction({
|
||||||
action: store.actions.next,
|
action: store.actions.next,
|
||||||
|
|
Loading…
Reference in New Issue