Add a Show Subtitles option

This commit is contained in:
mikiher 2024-07-04 20:35:58 +03:00
parent 6b6df619f5
commit 54f2bb1092
4 changed files with 76 additions and 2 deletions

View file

@ -11,7 +11,7 @@ function createMountOptions() {
mediaType: 'book',
media: {
id: 'book1',
metadata: { title: 'The Fellowship of the Ring', titleIgnorePrefix: 'Fellowship of the Ring', authorName: 'J. R. R. Tolkien' },
metadata: { title: 'The Fellowship of the Ring', titleIgnorePrefix: 'Fellowship of the Ring', authorName: 'J. R. R. Tolkien', subtitle: 'The Lord of the Rings, Book 1' },
numTracks: 1
}
}
@ -138,6 +138,16 @@ describe('LazyBookCard', () => {
})
})
it('shows subtitle when showSubtitles settings is true', () => {
mountOptions.mocks.$store.getters['user/getUserSetting'] = (settingName) => {
if (settingName === 'showSubtitles') return true
}
cy.mount(LazyBookCard, mountOptions)
cy.get('&titleImageNotReady').should('be.hidden')
cy.get('&subtitle').should('be.visible').and('have.text', 'The Lord of the Rings, Book 1')
})
it('shows overlay on mouseover', () => {
cy.mount(LazyBookCard, mountOptions)
cy.get('#book-card-0').trigger('mouseover')