diff --git a/cypress/e2e/transcript.cy.ts b/cypress/e2e/transcript.cy.ts index 92c4d20..310931e 100644 --- a/cypress/e2e/transcript.cy.ts +++ b/cypress/e2e/transcript.cy.ts @@ -1,3 +1,4 @@ +import {ui} from '@playkit-js/kaltura-player-js'; import {mockKalturaBe, loadPlayer, clickClosePluginButton} from './env'; const MANIFEST = `#EXTM3U @@ -232,17 +233,15 @@ describe('Transcript plugin', () => { it('should render small screen slate for small mobile screens', () => { cy.viewport('iphone-6'); - cy.on('window:before:load', win => { - Object.defineProperty(win.navigator, 'userAgent', { - value: - 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1' - }); - }); mockKalturaBe(); - loadPlayer().then(() => { + loadPlayer().then(kalturaPlayer => { + cy.viewport(414, 736); + // @ts-ignore + kalturaPlayer.ui.store.dispatch(ui.reducers.shell.actions.updateIsMobile(true)); cy.get(`[data-testid="transcript_smallScreenTextContent"]`).should('have.text', 'To see the transcript, rotate the phone'); cy.get(`[data-testid="transcript_smallScreenFullscreen"]`).should('not.exist'); cy.viewport('iphone-6', 'landscape'); + cy.viewport(736, 414); cy.get(`[data-testid="transcript_smallScreenTextContent"]`).should('not.be.visible'); }); }); diff --git a/package.json b/package.json index d3f6dcf..a9503f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@playkit-js/transcript", - "version": "3.5.0", + "version": "3.5.1", "main": "dist/playkit-transcript.js", "license": "AGPL-3.0", "private": false,