-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Create IdP registration integration test #669
test: Create IdP registration integration test #669
Conversation
2bdf9b8
to
36236d9
Compare
I'm currently having a very weird issue with this. Not even a clue why this is happening: Currently all the tests in the file are succeeding, except the last one which tries to access a resource on the server when logged in. The reason that one fails is because the Now, the problem is that if I delete that file (because I just wanted to quickly test it without the mock) suddenly all tests in this file fail with the following error:
The reason I'm guessing specifically this class is mentioned is because it's the first one being used in But I have no idea at all how removing the mock file could trigger this. Going to look more into this next week. Here's hoping it's just something silly somewhere that's easy to fix. Any suggestions what could cause this are welcome. |
Such an error might indicate (and hide) some other npm module-level error. You could try to print the error that's produced here: https://github.com/LinkedSoftwareDependencies/Components.js/blob/master/lib/construction/strategy/ConstructionStrategyCommonJs.ts#L40-L52 |
Update: was the same issue as matthieubosquet/ts-dpop#13, so we'll also have to include the same mapper in the jest config. |
36236d9
to
c2421ce
Compare
Test is finished and contains the following steps:
I think this covers all the major cases of the idp? I also tried to abstract away some of the calls that are the same for every scenario. I don't think there's a (clean) way to disable the DraftWarning so will probably have to leave this as it is currently. |
Mock DraftWarning? |
It's actually not an object that's made but an event that's emitted on |
We could mock |
c2421ce
to
34c02ce
Compare
Good idea, did that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR is not finished yet, but can already give an idea on how the integration tests for the IdP would work.
The panva oidc library does not work without cookies, so during the tests they have to be parsed and passed along.
Since our server only returns html, some html parsing is done to get the correct values needed for the next step. This does indicate that it would be possible in the future to support an API-based interface (still need the cookie headers though).
Currently get the warning below when running the tests. It's from the
solid-client-authn-js
library so if someone knows how to make sure it doesn't appear anymore please let me know.Next step is to add more steps in the step, specifically using the IdP for authentication and also invalid requests. Besides that some more cleaning up and potentially simplification.