Skip to content

Commit

Permalink
chore: fix tests, remove qunit only (#1449)
Browse files Browse the repository at this point in the history
* chore: fix tests, remove qunit only

* fix pathway cloning tests

---------

Co-authored-by: Dzianis Dashkevich <[email protected]>
Co-authored-by: Adam Waldron <[email protected]>
  • Loading branch information
3 people authored Nov 27, 2023
1 parent 9f2a4de commit f294133
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions test/playlist-controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6365,6 +6365,14 @@ QUnit.module('PlaylistController contentSteering', {
]
};

this.setupSteeringPlaylists = (pc, mainPlaylist) => {
pc.main = () => mainPlaylist;
pc.media = () => mainPlaylist.playlists[0];
pc.mainPlaylistLoader_.main = mainPlaylist;
pc.mainPlaylistLoader_.media = () => mainPlaylist.playlists[0];
pc.selectPlaylist = () => pc.main().playlists[0];
};

},
afterEach(assert) {
sharedHooks.afterEach.call(this, assert);
Expand Down Expand Up @@ -6892,6 +6900,10 @@ QUnit.test('Pathway cloning - add a new pathway when the clone has not existed',

const pc = new PlaylistController(options);

// Set up steering playlists
this.setupSteeringPlaylists(pc, this.csMainPlaylist);
pc.attachContentSteeringListeners_();

this.csMainPlaylist.playlists.forEach(p => {
p.attributes['PATHWAY-ID'] = p.attributes.serviceLocation;
p.attributes.serviceLocation = undefined;
Expand Down Expand Up @@ -6949,6 +6961,9 @@ QUnit.test('Pathway cloning - update the pathway when the BASE-ID does not match

const pc = new PlaylistController(options);

this.setupSteeringPlaylists(pc, this.csMainPlaylist);
pc.attachContentSteeringListeners_();

this.csMainPlaylist.playlists.forEach(p => {
p.attributes['PATHWAY-ID'] = p.attributes.serviceLocation;
p.attributes.serviceLocation = undefined;
Expand Down Expand Up @@ -7020,6 +7035,9 @@ QUnit.test('Pathway cloning - update the pathway when there is a new param', fun

const pc = new PlaylistController(options);

this.setupSteeringPlaylists(pc, this.csMainPlaylist);
pc.attachContentSteeringListeners_();

this.csMainPlaylist.playlists.forEach(p => {
p.attributes['PATHWAY-ID'] = p.attributes.serviceLocation;
p.attributes.serviceLocation = undefined;
Expand Down Expand Up @@ -7093,6 +7111,9 @@ QUnit.test('Pathway cloning - update the pathway when a param is missing', funct

const pc = new PlaylistController(options);

this.setupSteeringPlaylists(pc, this.csMainPlaylist);
pc.attachContentSteeringListeners_();

this.csMainPlaylist.playlists.forEach(p => {
p.attributes['PATHWAY-ID'] = p.attributes.serviceLocation;
p.attributes.serviceLocation = undefined;
Expand Down Expand Up @@ -7163,6 +7184,9 @@ QUnit.test('Pathway cloning - delete the pathway when it is no longer in the ste

const pc = new PlaylistController(options);

this.setupSteeringPlaylists(pc, this.csMainPlaylist);
pc.attachContentSteeringListeners_();

this.csMainPlaylist.playlists.forEach(p => {
p.attributes['PATHWAY-ID'] = p.attributes.serviceLocation;
p.attributes.serviceLocation = undefined;
Expand Down Expand Up @@ -7221,6 +7245,9 @@ QUnit.test('Pathway cloning - do nothing when next and past clones are the same'

const pc = new PlaylistController(options);

this.setupSteeringPlaylists(pc, this.csMainPlaylist);
pc.attachContentSteeringListeners_();

this.csMainPlaylist.playlists.forEach(p => {
p.attributes['PATHWAY-ID'] = p.attributes.serviceLocation;
p.attributes.serviceLocation = undefined;
Expand Down
2 changes: 1 addition & 1 deletion test/videojs-http-streaming.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ QUnit.test('VhsHandler is referenced by player.tech().vhs', function(assert) {
);
});

QUnit.test.only('options are updated when setOptions is called', function(assert) {
QUnit.test('options are updated when setOptions is called', function(assert) {
this.player.src({
src: 'manifest/playlist.m3u8',
type: 'application/vnd.apple.mpegurl'
Expand Down

0 comments on commit f294133

Please sign in to comment.