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

Update 'array item' tests to set arrays for the tested properties #56

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jchartrand
Copy link

This PR changes the following two tests in 10-issuer.js:

'"credential.type" items MUST be strings'

and

'credential "@context" items MUST be strings.'

so that they now set arrays for the properties to be tested.

The two tests both appear to be intended to test cases where the given property ('type' and '@context') is set to an array containing items that aren't strings, but I think the items aren't actually added into an array before setting.

For example, one of the requests that is sent for the 'type' test looks like so:

{
    "@context": [
        "https://www.w3.org/2018/credentials/v1"
    ],
    "type": 4,
    "credentialSubject": {
        "id": "did:key:z6MkhTNL7i2etLerDK8Acz5t528giE5KA4p75T6ka1E1D74r"
    },
    "issuanceDate": "2024-10-23T18:34:09Z",
    "id": "urn:uuid:f1ebf317-836a-46af-bf96-1eddab9cad81",
    "issuer": "did:key:z6MknNQD1WHLGGraFi6zcbGevuAgkVfdyCdtZnQTGWVVvR5Q"
}

whereas I think it was meant to be sent like so (which it now does with the committed fix):

{
    "@context": [
        "https://www.w3.org/2018/credentials/v1"
    ],
    "type": [
        4
    ],
    "credentialSubject": {
        "id": "did:key:z6MkhTNL7i2etLerDK8Acz5t528giE5KA4p75T6ka1E1D74r"
    },
    "issuanceDate": "2024-10-23T18:40:29Z",
    "id": "urn:uuid:55e11d97-8437-40b9-8381-cb62c350c231",
    "issuer": "did:key:z6MknNQD1WHLGGraFi6zcbGevuAgkVfdyCdtZnQTGWVVvR5Q"
}

change type and @context array item tests to send arrays
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.

1 participant