Hi there!
We're trying to upgrade authkit-react from 0.7.0 to the latest, 0.10.0. It works fine in our application, but we're having some issues getting our test suite passing.
In the latest version, there is a request/redirect to the /authorize endpoint on the workos API that I'm not quite sure how to mock correctly.
I've set up a reproduction in this repo. The main branch uses v0.10.0, while the 0.7.0 branch uses v0.7.0.
To reproduce:
- Clone the repo and checkout main
touch .env
- Add env vars for workos client
VITE_WORKOS_CLIENT_ID="some_client_id"
VITE_WORKOS_DEV_MODE="true"
- Run
npm install
- Run
npm run test
- Click play on the only test in the suite and see it fail
- Note, the test runner should have a logged in user. Instead, we see the log in screen
- Checkout
0.7.0 branch
- run
npm install again to get the old version of authkit-react
- Run
npm run test again
- Click play on the test, test passes
There seems to be a couple redirects through api.workos.com/user_management/ that we tried to mock in the test, but I don't think we have it quite right. Any suggestions on how to mock a response correctly here?
Hi there!
We're trying to upgrade authkit-react from
0.7.0to the latest,0.10.0. It works fine in our application, but we're having some issues getting our test suite passing.In the latest version, there is a request/redirect to the
/authorizeendpoint on the workos API that I'm not quite sure how to mock correctly.I've set up a reproduction in this repo. The
mainbranch usesv0.10.0, while the0.7.0branch usesv0.7.0.To reproduce:
touch .envnpm installnpm run test0.7.0branchnpm installagain to get the old version ofauthkit-reactnpm run testagainThere seems to be a couple redirects through
api.workos.com/user_management/that we tried to mock in the test, but I don't think we have it quite right. Any suggestions on how to mock a response correctly here?