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: breaking changes #642

Merged
merged 11 commits into from
Mar 14, 2023
Merged

test: breaking changes #642

merged 11 commits into from
Mar 14, 2023

Conversation

tjwelde
Copy link
Contributor

@tjwelde tjwelde commented Sep 22, 2022

fixes KILTProtocol/ticket#2081

Assert persistence of the following

  • All message types with their contents
    • | 'error'
    • | 'reject'
    • | 'request-terms'
    • | 'submit-terms'
    • | 'reject-terms'
    • | 'request-attestation'
    • | 'submit-attestation'
    • | 'reject-attestation'
    • | 'request-payment'
    • | 'confirm-payment'
    • | 'request-credential'
    • | 'submit-credential'
    • | 'accept-credential'
    • | 'reject-credential'
    • | 'request-accept-delegation'
    • | 'submit-accept-delegation'
    • | 'reject-accept-delegation'
    • | 'inform-create-delegation'
  • Message envelope
    • Created from contents
    • Created from encrypted message
  • Encrypted message
  • Light did uri (with encryption key and service endpoints)
    • Encode
    • Decode
  • full did uri
  • credential objects (indirectly though, via being included in messages)

How to test:

Please provide a brief step-by-step instruction.
If necessary, provide information about dependencies (specific configuration, branches, database dumps, etc.)

  • Step 1
  • Step 2
  • etc.

Checklist:

  • I have verified that the code works
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • I have left the code in a better state
  • I have documented the changes (where applicable)

# Conflicts:
#	packages/testing/package.json
#	yarn.lock
@arty-name arty-name requested a review from rflechtner February 22, 2023 13:52
@@ -80,14 +80,16 @@ describe('Breaking Changes', () => {
expect(did.uri).toMatchInlineSnapshot(
`"did:kilt:light:004quk8nu1MLvzdoT4fE6SJsLS4fFpyvuGz7sQpMF7ZAWTDoF5:z1msTRicERqs59nwMvp3yzMRBhUYGmkum7ehY7rtKQc8HzfEx4b4eyRhrc37ZShT3oG7E89x89vaG9W4hRxPS23EAFnCSeVbVRrKGJmFQvYhjgKSMmrGC7gSxgHe1a3g41uamhD49AEi13YVMkgeHpyEQJBy7N7gGyW7jTWFcwzAnws4wSazBVG1qHmVJrhmusoJoTfKTPKXkExKyur8Z341EkcRkHteY8dV3VjLXHnfhRW2yU9oM2cRm5ozgaufxrXsQBx33ygTW2wvrfzzXsYw4Bs6Vf2tC3ipBTDcKyCk6G88LYnzBosRM15W3KmDRciJ2iPjqiQkhYm77EQyaw"`
)

expect(Did.parseDocumentFromLightDid(did.uri)).toMatchSnapshot()
Copy link
Contributor

@rflechtner rflechtner Feb 27, 2023

Choose a reason for hiding this comment

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

my idea was to use a hard-coded did here to make sure that even if we update the snapshot above bc we change the way dids are encoded, we still make sure we can decode the original form.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, we can do that

resolveKey: makeResolveKey(aliceDid),
})

expect(decrypted).toMatchSnapshot()
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't it be better to compare against message to make sure they are the same instead of making a second snapshot which you'd have to compare manually to the first?

Suggested change
expect(decrypted).toMatchSnapshot()
expect(decrypted).toMatchObject(message)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good idea! 👍

Copy link
Contributor

@rflechtner rflechtner left a comment

Choose a reason for hiding this comment

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

let's merge this as-is

@arty-name arty-name marked this pull request as ready for review March 14, 2023 12:41
@arty-name arty-name merged commit 73439d1 into develop Mar 14, 2023
@arty-name arty-name deleted the tw-2081-breaking branch March 14, 2023 12:42
@rflechtner rflechtner mentioned this pull request Jun 8, 2023
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.

3 participants