@cypress/react and react-helmet. Can they work together? #16265
Unanswered
glomotion
asked this question in
Component Testing
Replies: 2 comments
-
FWIW, we tried to catch helmet updates from within the fixture, but no joy (see screenshots). ☝️ InventoryPage component triggers a helmet title change immediately on-mount. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think because the helmet is really meant to operate at the top level - at the document level, a more appropriate test here would be an E2E test, not a component test. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So the cypress docs mention things like
cy.title()
to verify that thedocument.title
is updating as things in react trigger title changes via react-helmet...Sadly though, when @cypress/react components are being tested (eg inside cypress run-ct)
cy.title()
ALWAYS returns the same string:Components App
.Has anyone managed to get
@cypress/react
&react-helmet
working together (so that helmet actually updates cy.title, for example)?Beta Was this translation helpful? Give feedback.
All reactions