Skip to content

Commit

Permalink
feat(CR-152): address comments2
Browse files Browse the repository at this point in the history
  • Loading branch information
semarche-kaltura committed Dec 9, 2024
1 parent a369eff commit 6d23533
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions cypress/e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ const getPlayer = () => {
};

const preparePage = (pluginConf = {}, playbackConf = {}) => {
cy.visit('index.html');
cy.visit('index.html', {
onBeforeLoad: (contentWindow: any) => {
contentWindow._TEST_ENV = true;
}
});
return cy.window().then(win => {
try {
// @ts-ignore
Expand All @@ -19,7 +23,7 @@ const preparePage = (pluginConf = {}, playbackConf = {}) => {
},
playback: {muted: true, autoplay: true, ...playbackConf},
plugins: {
timeline: {}
timeline: pluginConf
}
});
return kalturaPlayer.loadMedia({entryId: '0_wifqaipd'});
Expand Down
4 changes: 2 additions & 2 deletions src/timeline-manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class TimelineManager {
this._getThumbnailInfoFn = fn;
},
addSeekBarPreview: this._addSeekBarPreview,
// Expose the timelineManager to Cypress for testing purposes
...(window.Cypress ? {timelineManager: this} : {})
// Expose entire timelineManager for testing purposes
...((window as any)._TEST_ENV ? {timelineManager: this} : {})
};
}

Expand Down

0 comments on commit 6d23533

Please sign in to comment.