Created
April 13, 2020 22:40
-
-
Save daedalius/6d1a64db32d3a22fe2322db41e09b508 to your computer and use it in GitHub Desktop.
Cypress + Storybook. #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('closes via method call.', () => { | |
// arrange | |
let popup = React.createRef(); | |
cy.window().then((win) => { | |
// initial state - popup is visible | |
ReactDOM.render( | |
<win.Popup | |
showed={true} | |
ref={popup} | |
/>, | |
win.document.querySelector(rootToMountSelector) | |
); | |
}); | |
// act | |
cy.then(() => { popup.current.hide(); }) | |
// assert | |
cy | |
.get(selectors.popupWindow) | |
.should('not.be.visible'); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment