Skip to content

Instantly share code, notes, and snippets.

@daedalius
Created April 13, 2020 22:38
Show Gist options
  • Save daedalius/21bf9de5e43941238a736269a9f976f9 to your computer and use it in GitHub Desktop.
Save daedalius/21bf9de5e43941238a736269a9f976f9 to your computer and use it in GitHub Desktop.
Cypress + Storybook. #7
it('becomes hidden after being shown when showed=false passed.', () => {
// arrange
cy.window().then((win) => {
// initial state - popup is visible
ReactDOM.render(
<PopupTestWrapper
showed={true}
win={win}
/>,
win.document.querySelector(rootToMountSelector)
);
});
// act
cy.then(() => { setPopupTestWrapperState(false); })
// 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