WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 7575ba3

Browse files
committed
Cypres wait for breakpoint
1 parent 7e66f75 commit 7575ba3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cypress/integration/landing.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ describe('Landing Page', () => {
22
it('opens all sections', () => {
33
cy.visit('/')
44

5+
// all the images are loaded
56
cy.get('img[data-placeholder-image]').should('not.be.visible')
7+
// swiper is initialized
8+
cy.get('.swiper-initialized[data-breakpoint]').should('be.visible')
69

710
cy.percySnapshot('Landing Page', { widths: [700, 1200] })
811
})

workspaces/landing/src/components/organisms/experience-history/ExperienceHistory.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ const query = graphql`
3333

3434
SwiperCore.use([Pagination])
3535

36+
const handleSwiperBreakpointChange = (swiper: SwiperCore) =>
37+
swiper.el.setAttribute('data-breakpoint', swiper.currentBreakpoint)
38+
3639
const ExperienceHistory = () => {
3740
const {
3841
gcms: { experiences },
@@ -75,6 +78,7 @@ const ExperienceHistory = () => {
7578
slidesPerView: 3,
7679
},
7780
}}
81+
onBreakpoint={handleSwiperBreakpointChange}
7882
>
7983
{experiences.map((experience, index) => {
8084
return (

0 commit comments

Comments
 (0)