Skip to content

Commit

Permalink
add test case for custom player
Browse files Browse the repository at this point in the history
  • Loading branch information
adam187 committed Jul 25, 2016
1 parent 93371f5 commit 6010814
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/unit/player.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1044,3 +1044,15 @@ test('When VIDEOJS_NO_DYNAMIC_STYLE is set, apply sizing directly to the tech el
equal(player.tech_.el().width, 600, 'the width is equal to 600');
equal(player.tech_.el().height, 300, 'the height is equal 300');
});

test('should allow to use custom player class', function(){
class CustomPlayer extends Player {}
videojs.registerComponent('Player', CustomPlayer);

let tag = TestHelpers.makeTag();
let player = videojs(tag);

equal(player instanceof CustomPlayer, true, 'player is custom');

player.dispose();
});

0 comments on commit 6010814

Please sign in to comment.