refactor: use browser native lazy loading (backport #31814) (#31815)

refactor: use browser native lazy loading (#31814)

(cherry picked from commit 08d7c48dc7)

Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
mergify[bot]
2022-08-09 18:51:27 +05:30
committed by GitHub
parent 6046f8bc5e
commit c3fd802351
3 changed files with 7 additions and 3 deletions

View File

@@ -57,7 +57,11 @@ class TestHomepageSection(unittest.TestCase):
self.assertEqual(cards[0].h5.text, "Card 1")
self.assertEqual(cards[0].a["href"], "/card-1")
self.assertEqual(cards[1].p.text, "Subtitle 2")
self.assertEqual(cards[1].find(class_="website-image-lazy")["data-src"], "test.jpg")
img = cards[1].find(class_="card-img-top")
self.assertEqual(img["src"], "test.jpg")
self.assertEqual(img["loading"], "lazy")
# cleanup
frappe.db.rollback()