Closed nedimcimpohtec closed 2 years ago
@nedimcimpohtec Yes, that is because the next-translate-routes plugin automatically adds the next-translate-routes data to withTranslateRoutes. You can add this to your unit tests:
window.__NEXT_TRANSLATE_ROUTES_DATA = ntrData // see TNtrData from 'next-translate-routes/types'
To build the ntrData object, you can use the parsePageTree
function from 'next-translate-routes/config'
Some additional docs are required...
@nedimcimpohtec I added a createNtrData
helper in v. 1.8.0. See how to use it in the docs.
There is page 404.tsx and unit test for the same page
import { act, render } from "test/utils";
But when I try to run tests...
● Test suite failed to run
Note that there is skip but it still failes and there is next-translate-routes added in the config because some tests not related do pages are ok
Versions:
"next": "12.0.4" "next-translate-routes": "^1.7.1"