Skip to content

Commit

Permalink
fix(FEC-12161): Need to replace static jpg files in player tests
Browse files Browse the repository at this point in the history
Replace static images with data URIs
  • Loading branch information
SivanA-Kaltura authored Apr 13, 2022
1 parent 8e3cc43 commit ae2798a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
5 changes: 3 additions & 2 deletions test/src/common/thumbnail-manager.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import {MediaType} from '@playkit-js/playkit-js';
import {DefaultThumbnailConfig, ThumbnailManager} from '../../../src/common/thumbnail-manager';
import * as TestUtils from '../utils/test-utils';
import {setup} from '../../../src';
import {Images} from '../mock-data/images';

describe('ThumbnailManager', () => {
let thumbnailManager, fakePlayer, fakeMediaConfig, sandbox;
const thumbsSprite = 'thumbsSprite.jpg';
const thumbsSprite = Images.THUMBNAILS_SPRITE;
const fakeSeekbarConfig = {
thumbsSlices: 200,
thumbsWidth: 100
Expand Down Expand Up @@ -156,7 +157,7 @@ describe('ThumbnailManager', () => {
const targetId = 'player-placeholder_ovp/thumbnail.spec';

let config, kalturaPlayer;
const myCustomPosterUrl = 'poster.jpg';
const myCustomPosterUrl = Images.POSTER;
const entryId = '0_wifqaipd';
const partnerId = 1091;
const env = {
Expand Down
13 changes: 7 additions & 6 deletions test/src/common/utils/setup-helpers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {ValidationErrorType} from '../../../../src/common/utils/validation-error
import StorageManager from '../../../../src/common/storage/storage-manager';
import * as SetupHelpers from '../../../../src/common/utils/setup-helpers';
import {Env} from '@playkit-js/playkit-js';
import {Images} from '../../mock-data/images';

const targetId = 'player-placeholder_setup-helpers.spec';

Expand Down Expand Up @@ -239,7 +240,7 @@ describe('supportLegacyOptions', function () {
autoplay: false
},
metadata: {
poster: 'poster.jpg'
poster: Images.POSTER
}
},
provider: {
Expand All @@ -248,7 +249,7 @@ describe('supportLegacyOptions', function () {
ui: {
components: {
seekbar: {
thumbsSprite: 'thumbsSprite.jpg'
thumbsSprite: Images.THUMBNAILS_SPRITE
}
}
}
Expand All @@ -268,7 +269,7 @@ describe('supportLegacyOptions', function () {
autoplay: false
},
metadata: {
poster: 'poster.jpg'
poster: Images.POSTER
}
},
provider: {
Expand All @@ -277,7 +278,7 @@ describe('supportLegacyOptions', function () {
ui: {
components: {
seekbar: {
thumbsSprite: 'thumbsSprite.jpg'
thumbsSprite: Images.THUMBNAILS_SPRITE
}
}
}
Expand All @@ -289,7 +290,7 @@ describe('supportLegacyOptions', function () {
dvr: false,
type: 'Live',
duration: 10000,
poster: 'poster.jpg',
poster: Images.POSTER,
metadata: {
name: 'name'
}
Expand All @@ -303,7 +304,7 @@ describe('supportLegacyOptions', function () {
ui: {
components: {
seekbar: {
thumbsSprite: 'thumbsSprite.jpg'
thumbsSprite: Images.THUMBNAILS_SPRITE
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion test/src/kaltura-player.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {EventType as CoreEventType, FakeEvent, Utils, EventManager} from '@playk
import AsyncResolvePlugin from './common/plugin/test-plugins/async-resolve-plugin';
import AsyncRejectPlugin from './common/plugin/test-plugins/async-reject-plugin';
import {Provider} from 'playkit-js-providers';
import {Images} from './mock-data/images';

const targetId = 'player-placeholder_kaltura-player.spec';

Expand Down Expand Up @@ -105,7 +106,7 @@ describe('kaltura player api', function () {
});

it('should use the configured poster from loadMedia options', function (done) {
const poster = 'poster.jpg';
const poster = Images.POSTER;
kalturaPlayer.addEventListener(kalturaPlayer.Event.CHANGE_SOURCE_ENDED, () => {
kalturaPlayer.poster.should.equal(poster);
done();
Expand Down
8 changes: 8 additions & 0 deletions test/src/mock-data/images.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion test/src/ovp/poster.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {addKalturaPoster} from '../../../src/ovp/poster';
import * as TestUtils from '../utils/test-utils';
import {setup} from '../../../src/setup';
import {Provider} from 'playkit-js-providers';
import {Images} from '../mock-data/images';

const targetId = 'player-placeholder_ovp/poster.spec';

Expand Down Expand Up @@ -44,7 +45,7 @@ describe('addKalturaPoster', function () {

describe('Poster Integration', function () {
let config, kalturaPlayer, sandbox, provider;
const myCustomPosterUrl = 'poster.jpg';
const myCustomPosterUrl = Images.POSTER;
const entryId = '0_wifqaipd';
const alterEntryId = '0_4ktof5po';
const partnerId = 1091;
Expand Down

0 comments on commit ae2798a

Please sign in to comment.