mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-24 12:21:42 +00:00
Fix MediaPlayerContainer Cypress harness bootstrap
This commit is contained in:
parent
27726e5d6c
commit
7d58adddd4
1 changed files with 9 additions and 2 deletions
|
|
@ -95,11 +95,18 @@ describe('MediaPlayerContainer', () => {
|
||||||
win.MediaMetadata = function MediaMetadata(metadata) {
|
win.MediaMetadata = function MediaMetadata(metadata) {
|
||||||
Object.assign(this, metadata)
|
Object.assign(this, metadata)
|
||||||
}
|
}
|
||||||
win.navigator.mediaSession = {
|
const mediaSession = {
|
||||||
playbackState: 'none',
|
playbackState: 'none',
|
||||||
metadata: null,
|
metadata: null,
|
||||||
setActionHandler: cy.stub().as('setActionHandler')
|
setActionHandler: cy.stub().as('setActionHandler')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Object.defineProperty(win.navigator, 'mediaSession', {
|
||||||
|
configurable: true,
|
||||||
|
get() {
|
||||||
|
return mediaSession
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -188,7 +195,7 @@ describe('MediaPlayerContainer', () => {
|
||||||
'modals-player-settings-modal': { template: '<div />' },
|
'modals-player-settings-modal': { template: '<div />' },
|
||||||
'controls-playback-speed-control': { template: '<div />' },
|
'controls-playback-speed-control': { template: '<div />' },
|
||||||
'controls-volume-control': { template: '<div />' },
|
'controls-volume-control': { template: '<div />' },
|
||||||
'player-track-bar': { template: '<div />', methods: { setUseChapterTrack() {}, setCurrentTime() {}, setBufferTime() {}, setPercentageReady() {} } },
|
'player-track-bar': { template: '<div />', methods: { setDuration() {}, setUseChapterTrack() {}, setCurrentTime() {}, setBufferTime() {}, setPercentageReady() {} } },
|
||||||
'nuxt-link': { template: '<a><slot /></a>' }
|
'nuxt-link': { template: '<a><slot /></a>' }
|
||||||
},
|
},
|
||||||
mocks: {
|
mocks: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue