|
1 | 1 | import Elements from '../support/elements'; |
2 | | -import {clickAccordionHeader, clickFilter, search} from '../support/common'; |
| 2 | +import {clickAccordionHeader, clickFilter, clickPage, search} from '../support/common'; |
3 | 3 | import helpers from '../../src/store/helpers'; |
4 | 4 |
|
5 | 5 | describe('Book cards', function () { |
@@ -70,7 +70,7 @@ describe('Book cards', function () { |
70 | 70 | search('Nursing Pharmacology').then(()=>{ |
71 | 71 | cy.get(Elements.booksCards.editors) |
72 | 72 | .first() |
73 | | - .contains('Elizabeth Christman, MSN, RN, CNE and Kimberly Ernstmeyer, CNE, CHSE, APNP-BC'); |
| 73 | + .should('include.text', 'Elizabeth Christman, MSN, RN, CNE and Kimberly Ernstmeyer'); |
74 | 74 | }); |
75 | 75 | }); |
76 | 76 | it('Search a book with description and check it is present in the book cards', () => { |
@@ -183,9 +183,24 @@ describe('Book cards', function () { |
183 | 183 | search('math'); |
184 | 184 |
|
185 | 185 | cy.get(Elements.booksCards.cover) |
186 | | - .eq(1).find('img') |
| 186 | + .eq(3).find('img') |
187 | 187 | .should('have.attr', 'src') |
188 | 188 | .should('include', '/assets/images/default-book-cover.jpg'); |
189 | 189 | }); |
| 190 | + it('Lazy loading cover images', () => { |
| 191 | + clickPage(3); |
| 192 | + |
| 193 | + cy.get(Elements.booksCards.cover) |
| 194 | + .eq(2).find('img') |
| 195 | + .should('have.attr', 'src') |
| 196 | + .should('include', '/assets/images/default-book-cover.jpg'); |
| 197 | + |
| 198 | + cy.get('[data-cy=storage-filter]').scrollIntoView() |
| 199 | + .wait(200); |
| 200 | + cy.get(Elements.booksCards.cover) |
| 201 | + .eq(2).find('img') |
| 202 | + .should('have.attr', 'src') |
| 203 | + .should('include', 'monarch.jpg'); |
| 204 | + }); |
190 | 205 | }); |
191 | 206 | }); |
0 commit comments