Skip to content

Commit

Permalink
fix: allow rounded value for fluid player ratio test (#3739)
Browse files Browse the repository at this point in the history
  • Loading branch information
mister-ben authored and gkatsev committed Nov 3, 2016
1 parent 8f7eb12 commit 2e720af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/unit/player.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,10 @@ QUnit.test('should set the width, height, and aspect ratio via a css class', fun

QUnit.test('should default to 16:9 when fluid', function(assert) {
const player = TestHelpers.makePlayer({fluid: true});
const ratio = player.currentHeight() / player.currentWidth();

assert.equal(player.currentHeight() / player.currentWidth(), 0.5625, 'fluid player without dimensions defaults to 16:9');
// IE8 rounds 0.5625 up to 0.563
assert.ok(((ratio >= 0.562) && (ratio <= 0.563)), 'fluid player without dimensions defaults to 16:9');
});

QUnit.test('should set fluid to true if element has vjs-fluid class', function(assert) {
Expand Down

0 comments on commit 2e720af

Please sign in to comment.