Skip to content
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: fix compile errors in commands.ts #3179

Merged
merged 1 commit into from Mar 21, 2023

Conversation

jonas-jonas
Copy link
Contributor

@jonas-jonas jonas-jonas commented Mar 20, 2023

Fixes a few compile time issues in the cypress commands and adds generation of a type declaration for the Kratos configuration to be used within E2E tests.

Related issue(s)

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

@jonas-jonas jonas-jonas force-pushed the jonas-jonas/fix/e2eCompileErrors branch from d1e02db to eb0a265 Compare March 20, 2023 19:45
@@ -16,6 +16,7 @@
"cypress": "^11.2.0",
"dayjs": "^1.10.4",
"got": "^11.8.2",
"json-schema-to-typescript": "^12.0.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tool is pretty cool! We now have a generated d.ts file of our config, that we can use in the tests to get typesafe config updates. Always bugged me, that I wasn't able to get code completion when working with it.

https://github.com/bcherny/json-schema-to-typescript#readme

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool idea

@jonas-jonas jonas-jonas changed the title chore(e2e): fix compile errors in commands chore(e2e): fix compile errors in commands.ts Mar 20, 2023
@jonas-jonas jonas-jonas changed the title chore(e2e): fix compile errors in commands.ts test: fix compile errors in commands.ts Mar 20, 2023
@@ -147,7 +147,9 @@ context("Registration success with email profile with webhooks", () => {
expect(identity.schema_id).to.equal("default")
expect(identity.schema_url).to.equal(`${APP_URL}/schemas/ZGVmYXVsdA`)
expect(identity.traits.email).to.equal("updated-" + email)
expect(identity.metadata_public.some).to.equal("public fields")
expect((identity as any).metadata_public.some).to.equal(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These types still use a pretty old version of @ory/kratos-client, where metadata_public didn't exist, yet. But I want to do that in a future PR.

Comment on lines +11 to +15
export type OryKratosConfiguration = OryKratosConfiguration1 &
OryKratosConfiguration2
export type OryKratosConfiguration1 = {
[k: string]: unknown | undefined
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, why it generates these 1, 2 versions, but I traced it to being related to the allOf block at the end of the config. Not sure if there is anything we can do about that here.

@codecov
Copy link

codecov bot commented Mar 20, 2023

Codecov Report

Merging #3179 (9c8bd0c) into master (5403f86) will decrease coverage by 0.11%.
The diff coverage is n/a.

❗ Current head 9c8bd0c differs from pull request most recent head eb0a265. Consider uploading reports for the commit eb0a265 to get more accurate results

@@            Coverage Diff             @@
##           master    #3179      +/-   ##
==========================================
- Coverage   77.73%   77.62%   -0.11%     
==========================================
  Files         317      317              
  Lines       20046    20046              
==========================================
- Hits        15583    15561      -22     
- Misses       3275     3292      +17     
- Partials     1188     1193       +5     

see 4 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@aeneasr aeneasr merged commit 0002668 into master Mar 21, 2023
25 of 27 checks passed
@aeneasr aeneasr deleted the jonas-jonas/fix/e2eCompileErrors branch March 21, 2023 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants