Skip to content

Commit

Permalink
test: fix IE9 rounding issue with lastvolume test (#4230)
Browse files Browse the repository at this point in the history
#4227 caused an error in IE9 because it returns back a bad float number.
Instead, we toFixed(1) the response
  • Loading branch information
kevinlitchfield authored and gkatsev committed Mar 24, 2017
1 parent 16c1e0a commit 46dd0aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/unit/controls.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ if (Html5.isSupported()) {

muteToggle.handleClick();

assert.equal(player.volume(), 0.1, 'since lastVolume is less than 0.1, volume is set to 0.1');
// `Number.prototype.toFixed()` is used here to circumvent IE9 rounding issues
assert.equal(player.volume().toFixed(1), (0.1).toFixed(1), 'since lastVolume is less than 0.1, volume is set to 0.1');
assert.equal(player.muted(), false, 'muted is set to false');
});

Expand Down

0 comments on commit 46dd0aa

Please sign in to comment.