Skip to content

Commit

Permalink
Re-enabled skipped test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisn committed Aug 22, 2017
1 parent 6088169 commit bb8dbce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions test/unit/api-player-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,32 @@ describe('Peaks.player', function() {
}
});

describe.skip('getCurrentTime', function() {
describe('getCurrentTime', function() {
var newTime = 6.0;

it('should return the actual value of the audio element', function() {
expect(p.player.getCurrentTime()).to.equal(0);
});

// @see https://github.com/bbc/peaks.js/issues/9
// @see https://github.com/bbc/peaks.js/issues/12
// For some reason, the event is not emitted during the tests
it('should return an updated time if it has been modified through the audio element', function(done) {
p.on('player_seek', function(currentTime) {
expect(p.player.getCurrentTime()).to.equal(newTime);
expect(currentTime).to.equal(newTime);
var diff = Math.abs(p.player.getCurrentTime() - newTime);
expect(diff).to.be.lessThan(0.2);
done();
});

document.querySelector('audio').currentTime = newTime;
});
});

describe.skip('seek', function() {
describe('seek', function() {
var newTime = 6.0;

it('should change the currentTime value of the audio element', function() {
p.player.seek(newTime);

expect(p.player.getCurrentTime()).to.equal(newTime);
var diff = Math.abs(p.player.getCurrentTime() - newTime);
expect(diff).to.be.lessThan(0.2);
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/unit/api-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ describe('Peaks', function() {
});
});

it.skip('should emit an error if the data handling fails due to a network error', function(done) {
it('should emit an error if the data handling fails due to a network error', function(done) {
p = Peaks.init({
container: document.getElementById('waveform-visualiser-container'),
mediaElement: document.querySelector('audio'),
Expand Down

0 comments on commit bb8dbce

Please sign in to comment.