Commit 80af4268 authored by Ana Gelez's avatar Ana Gelez

Tests

parent 6b8dc1b5
......@@ -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: []
expectedActions: [
{ type: 'currentIndex', payload: 0 }
]
}, done)
})
it('previous', (done) => {
it('previous after less than 3 seconds of playback', (done) => {
testAction({
action: store.actions.previous,
params: {state: {currentIndex: 1}},
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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment