Skip to content

Commit

Permalink
Put book_placholder.jpg in browser cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mikiher committed Apr 29, 2024
1 parent e5fe31f commit 2bd532e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/components/cards/LazySeriesCard.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('LazySeriesCard', () => {
'user/getUserCanUpdate': true,
'user/getUserMediaProgress': (id) => null,
'libraries/getLibraryProvider': () => 'audible.us',
'globals/getLibraryItemCoverSrc': () => '/book_placeholder.jpg'
'globals/getLibraryItemCoverSrc': () => 'https://my.server.com/book_placeholder.jpg'
},
state: {
libraries: {
Expand All @@ -53,7 +53,10 @@ describe('LazySeriesCard', () => {
}

before(() => {
cy.intercept('GET', '/book_placeholder.jpg', { fixture: 'images/book_placeholder.jpg' })
cy.intercept('GET', 'https://my.server.com/book_placeholder.jpg', { fixture: 'images/book_placeholder.jpg' }).as('bookCover')
cy.mount(LazySeriesCard, { propsData, stubs, mocks })
cy.wait('@bookCover')
// Now the placeholder image is in the browser cache
})

it('renders the component', () => {
Expand Down

0 comments on commit 2bd532e

Please sign in to comment.