Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mister-ben committed Aug 3, 2022
1 parent bb5b741 commit ac276d9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/unit/tech/tech.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -770,3 +770,21 @@ QUnit.test('returns an empty object for getVideoPlaybackQuality', function(asser
assert.deepEqual(tech.getVideoPlaybackQuality(), {}, 'returns an empty object');
tech.dispose();
});

QUnit.test('requestVideoFrameCallback waits if tech not ready', function(assert) {
const tech = new Tech();
const cbSpy = sinon.spy();

tech.paused = sinon.spy();
tech.isReady_ = false;

tech.requestVideoFrameCallback(cbSpy);

assert.notOk(tech.paused.called, 'paused not called on tech that is not ready');

tech.trigger('playing');

assert.ok(cbSpy.called, 'callback was called on tech playing');

tech.dispose();
});

0 comments on commit ac276d9

Please # to comment.