Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/back-to-top.spec.js
Show All 21 Lines | cy.scrollTo('bottom') | ||||
.should('be.visible'); | .should('be.visible'); | ||||
}); | }); | ||||
it('should scroll to top when clicked', function() { | it('should scroll to top when clicked', function() { | ||||
cy.scrollTo('bottom') | cy.scrollTo('bottom') | ||||
.get('#back-to-top') | .get('#back-to-top') | ||||
.click() | .click() | ||||
.window() | .window() | ||||
.then((window) => { | .then(win => { | ||||
assert.equal(window.scrollY, 0); | assert.equal(win.scrollY, 0); | ||||
}); | }); | ||||
}); | }); | ||||
}); | }); |