NextJS with i18n support testing #24708
Unanswered
rdagostino
asked this question in
Questions and Help
Replies: 0 comments
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.
-
I'm working
Next 13
,next-i18next
andCypress 11
and developing an application that responds to API requests and displays different components/content based on the locale defined in our environment variables that are set during our pipeline build.The locale is set at application start
Based on the locale set we define a configuration for feature flags that we enable/disable accordingly. The features are utilized in two ways:
getStaticProps|getServerSideProps
in which we get the flag values and pass them through to their respective React components. We take this approach to avoid flashing in the application when accessing pages directly.Then when using Cypress, I want to test the differences in displays based on that locale. However, I'm unable to find a solution to do this.
I've reached out on the Cypress discord and was given some direction to look at mocking props
A small reproducible repo for this issue -> https://github.com/rdagostino/cypress-i18n
Any ideas or suggestions around this is greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions