Skip to content
New issue

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

Non-existent components fail should("not.exist") assertions #96

Closed
caseyjhol opened this issue Nov 24, 2020 · 5 comments · Fixed by #113
Closed

Non-existent components fail should("not.exist") assertions #96

caseyjhol opened this issue Nov 24, 2020 · 5 comments · Fixed by #113
Labels
bug Something isn't working

Comments

@caseyjhol
Copy link

caseyjhol commented Nov 24, 2020

  • cypress-react-selector v2.2.1

I'm trying to assert that there are 0 AccountCards on the page.

cy.react("AccountCard").should("not.exist") throws:

Component not found <AccountCard>

image

So, it's correct - the component is not found. However, I would expect for the assertion to pass, not fail.

cy.react("AccountCard").should("have.length", 0); runs into a similar issue.

@abhinaba-ghosh
Copy link
Owner

Thanks for raising this. Will look over the weekend. Appreciate a PR to fix this.

@abhinaba-ghosh abhinaba-ghosh added the bug Something isn't working label Nov 26, 2020
@abhinaba-ghosh abhinaba-ghosh linked a pull request Dec 15, 2020 that will close this issue
@abhinaba-ghosh
Copy link
Owner

Hi @caseyjhol , the fix is avialble in v2.2.2. Let me know if you get any hiccups.

@caseyjhol
Copy link
Author

Awesome - thanks! I'll try this out and let you know how it goes.

@caseyjhol
Copy link
Author

Gave this a try and it seems to be fixed - thanks again!

@abhinaba-ghosh
Copy link
Owner

Thanks @caseyjhol. Good to know.

If this library helping you in your development journey, you can optionally choose to sponsor/ support ❤️ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants