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

feat: support for component testing #742

Open
prescottprue opened this issue Dec 30, 2022 · 0 comments
Open

feat: support for component testing #742

prescottprue opened this issue Dec 30, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@prescottprue
Copy link
Owner

Is your feature request related to a problem? Please describe.
Feature request since it isn't currently supported, but based on problem originally described by @andershoegh in this issue:

@prescottprue we've been playing around with component testing and we've got commands working. However, we've stumbled into an issue with onAuthStateChanged.

Our app depends on the onAuthStateChanged setting the user. When using cy.login() in a component test we get null and thus the app can't get past our login screen when we test components that depend on authentication and user role functionality. With no difference in the setup we can run E2E without a problem. The only thing I can think of is that in E2E we run the cy.visit command after cy.login, which we do not in component tests. Maybe that's the reason that onAuthStateChanged never runs and yields a user object?

Looking forward to being able to use cypress-firebase for component testing as well! It's an integral part of our testing efforts. Great work on this libary @prescottprue :-)

Currently onAuthStateChanged does not appear to trigger in component testing

Describe the solution you'd like
Component testing working the same way as e2e testing or a clear documentation for component testing

Describe alternatives you've considered

Additional context

@prescottprue prescottprue added the enhancement New feature or request label Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant