Skip to content

Commit

Permalink
fix(player): continuous playing #8
Browse files Browse the repository at this point in the history
  • Loading branch information
rudywaltz committed Mar 16, 2019
1 parent 08b0a64 commit 31e3719
Show file tree
Hide file tree
Showing 7 changed files with 343 additions and 488 deletions.
31 changes: 17 additions & 14 deletions cypress/integration/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('player', () => {
it('play sound', () => {
cy.get('#player .player__play')
.click();
cy.get('#player .player__play').contains('Pause')
cy.get('#player .player__play').contains('Stop')
});

it('stop sound', () => {
Expand All @@ -80,32 +80,35 @@ describe('player', () => {
cy.get('#player .player__seek')
.click()
cy.get('#player .player__current')
.contains('00:01:02')
.contains('00:00:32')
cy.get('.progress__bar')
.should( $div => {
expect($div[0].style.width).to.be.greaterThan('10%');
expect($div[0].style.width).to.be.greaterThan('5%');
})
});

it('play next sound continously', () => {
cy.setStorage('song', {});
cy.setStorage('playlist', [{
title: 'Gongs',
url: '/gongs.mp3',
duration: 22
},
{
title: 'Jézus és a jelzőrakéta',
url: '/jezusesajelzoraketa.mp3'
}, {
title: 'Jézus és a jelzőrakéta111111',
url: '/jezusesajelzoraketa.mp3'
}])
url: '/jezusesajelzoraketa.mp3',
duration: (60 * 60) + (15 * 60) + 13
}]);

cy.get('#player .player__play')
.click()
cy.get('#player .player__seek')
.click()
.click()
.click()
.click()
.click()
.click()
cy.get('.player__title').contains('Jézus és a jelzőrakéta111111')

cy.get('.player__title')
.contains('Jézus és a jelzőrakéta')
cy.get('#player .player__current')
.contains('00:00:01')
});
});
});
6 changes: 3 additions & 3 deletions cypress/integration/playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ describe('playlist', () => {
duration: (60 * 60) + (15 * 60) + 13
},
{
title: 'Lorem ipsum',
url: '/aaaa.mp3',
duration: (2 * 60 * 60) + (4 * 60) + 9
title: 'Gongs',
url: '/gongs.mp3',
duration: 22
}]);

cy.get(':nth-child(2) > .song__clear')
Expand Down
Loading

0 comments on commit 31e3719

Please sign in to comment.