From 46dd0aac110f76b9a2161a077ab15f95fac1653e Mon Sep 17 00:00:00 2001 From: Kevin Litchfield Date: Fri, 24 Mar 2017 18:26:28 -0400 Subject: [PATCH] test: fix IE9 rounding issue with lastvolume test (#4230) #4227 caused an error in IE9 because it returns back a bad float number. Instead, we toFixed(1) the response --- test/unit/controls.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/unit/controls.test.js b/test/unit/controls.test.js index 0b432cd957..00d976059c 100644 --- a/test/unit/controls.test.js +++ b/test/unit/controls.test.js @@ -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'); });