Skip to content

Instantly share code, notes, and snippets.

@daedalius
Created April 13, 2020 22:40
Show Gist options
  • Save daedalius/6d1a64db32d3a22fe2322db41e09b508 to your computer and use it in GitHub Desktop.
Save daedalius/6d1a64db32d3a22fe2322db41e09b508 to your computer and use it in GitHub Desktop.
Cypress + Storybook. #8
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