Tests
This commit is contained in:
parent
6b8dc1b53c
commit
80af4268e3
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue