Skip to content

Commit

Permalink
fix: import index.js to e2e tests (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Ziv authored and OrenMe committed Oct 26, 2017
1 parent d6f932a commit ccd8dbc
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/src/setup.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import '../../src/index'
import {setup} from '../../src/setup'
import * as TestUtils from 'playkit-js/test/src/utils/test-utils'
import StorageWrapper from "../../src/storage/storage-wrapper";

const targetId = 'player-placeholder_setup.spec';

describe('setup', function () {

let providerConfig, kalturaPlayer, sandbox;

before(function () {
Expand Down Expand Up @@ -51,7 +51,7 @@ describe('setup', function () {
kalturaPlayer.loadMedia.should.exist;
kalturaPlayer.loadMedia(providerConfig.entryId)
.then(() => {
kalturaPlayer.ready().then(()=>{
kalturaPlayer.ready().then(() => {
let sessionIdRegex = /playSessionId=((?:[a-z0-9]|-|:)*)/i;
sessionIdRegex.exec(kalturaPlayer.src)[1].should.equal(kalturaPlayer.config.session.id);
done();
Expand All @@ -61,7 +61,15 @@ describe('setup', function () {
});

it('should set text style from storage', function () {
let textStyle = {"fontSize":"20%","fontFamily":"sans-serif","fontColor":[14,15,0],"fontOpacity":0,"backgroundColor":[1,2,3],"backgroundOpacity":1,"fontEdge":[]};
let textStyle = {
"fontSize": "20%",
"fontFamily": "sans-serif",
"fontColor": [14, 15, 0],
"fontOpacity": 0,
"backgroundColor": [1, 2, 3],
"backgroundOpacity": 1,
"fontEdge": []
};
sandbox.stub(StorageWrapper, 'getItem').withArgs('textStyle').returns(textStyle);
kalturaPlayer = setup(targetId, providerConfig);
kalturaPlayer.textStyle.should.deep.equal(textStyle);
Expand Down

0 comments on commit ccd8dbc

Please sign in to comment.