Need help fixing breaking test on Cognito Integration PR

Hello everyone !

I am currently making my first contribution, the Cognito integration, and I’m struggling a bit with some failing tests (they seems to all fail for the same reason).

So I’m wondering if anyone here would have any idea ?

I made a few observations:

  1. The tests fails only when the Cognito integration is added on the authClients/index.ts file
  2. The tests failing seems to be using the custom authentication mode
  3. The tests fails because the text Only absolute URLs are supported is found instead of Log Out, due to an error
  4. This line is triggering the error
  5. I checked the result from this.getApiGraphQLUrl() and it is the same both when the test run with Cognito added to the authClients and without Cognito: /.netlify/functions/graphql

Thanks for your help !

Link to the failing tests as I can only have 2 links in my original post :smile:

I still can’t find a solution to these breaking tests. Anyone has an idea ?

Sorry I’m very new to RW so can’t help much.
Is it possible that the init is being run when the tests are run and new CognitoUserPool is throwing an error due to missing environment vars, which ends up being rendered instead of the Log out link.

Dunno how much @dthyresson knows about Cognito but he’s the resident auth expert so should be able to help troubleshoot.