Skip to content

Commit

Permalink
chore: fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Sep 27, 2024
1 parent 78339f3 commit 020cb9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@ describe('create Request Uri should', () => {
})

it('return an url with an embedded token value', async () => {
//expect.assertions(3)
expect.assertions(2)
expect.assertions(3)
const opts: CreateAuthorizationRequestOpts = {
version: SupportedVersion.SIOPv2_ID1,
payload: {
Expand Down Expand Up @@ -363,7 +362,7 @@ describe('create Request Uri should', () => {
const uriRequest = await URI.fromOpts(opts)

const uriDecoded = decodeURIComponent(uriRequest.encodedUri)
expect(uriDecoded).toContain(`openid4vp://?request=eyJhbGciOi`)
expect(uriDecoded).toContain(`penid4vp://?client_id=https://www.example.com/`)

const data = URI.parse(uriDecoded)
expect(data.scheme).toEqual('openid4vp://')
Expand Down Expand Up @@ -696,7 +695,7 @@ describe('create Request JWT should', () => {
const uriRequest = await URI.fromOpts(opts)

const uriDecoded = decodeURIComponent(uriRequest.encodedUri)
expect(uriDecoded).toEqual(`openid4vp://?request_uri=https://rp.acme.com/siop/jwts`)
expect(uriDecoded).toEqual(`openid4vp://?client_id=https://www.example.com/.well-known/openid-federation&scope=test&response_type=id_token&request_object_signing_alg_values_supported=[\"ES256\",\"EdDSA\"]&redirect_uri=https://acme.com/hello&claims={"vp_token\":{\"presentation_definition":{\"id\":\"Ontario Health Insurance Plan\",\"name\":"Ontario\",\"purpose":"purpose\","input_descriptors":[{\"id":\"Ontario Health Insurance Plan\",\"name":\"Ontario\",\"schema":[{\"uri\":\"https://did.itsourweb.org:3000/smartcredential/Ontario-Health-Insurance-Plan\"}]}]}}}&request_uri=https://rp.acme.com/siop/jwts`)
expect((await (await uriRequest.toAuthorizationRequest())?.requestObject?.getPayload())?.claims.vp_token).toBeDefined()
})

Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 020cb9a

Please sign in to comment.