prescottprue/cypress-firebase

feat: support for component testing

prescottprue opened this issue · 0 comments

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