We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I run .getCurrentState I get back an object with two properties. But I'm having trouble doing anything with them.
const state = cy.getReact("Comp").getCurrentState(); cy.log(state); //logs: {hidden: false, context: Object{6}} const state = cy.getReact("Comp").getCurrentState().context; cy.log(state); //logs nothing
Nothing I'm trying works, how do I make assertions against the getCurrentState return?
cy.getReact("Comp").getCurrentState() .should(($state) => { expect($state.context.active.should("have.length", 3)) });
Attempt 2
cy.getReact("Comp").getCurrentState("context.active").should("have.length", 3)
Attempt 3
const state = cy .getReact("Graphin") .getCurrentState() .then((data) => cy.log(JSON.stringify(data))); cy.log(state); //Throws TypeError: Converting circular structure to JSON --> starting at object with constructor 'HTMLDivElement' | property '__reactInternalInstance$977odfgpjmb' -> object with constructor 'FiberNode' --- property 'stateNode' closes the circle
It doesn't seem to work like getProps, but I can't find any documentation on how I would make assertions against the return.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When I run .getCurrentState I get back an object with two properties. But I'm having trouble doing anything with them.
Nothing I'm trying works, how do I make assertions against the getCurrentState return?
Attempt 2
cy.getReact("Comp").getCurrentState("context.active").should("have.length", 3)
Attempt 3
It doesn't seem to work like getProps, but I can't find any documentation on how I would make assertions against the return.
The text was updated successfully, but these errors were encountered: