Skip to content

Commit 056c868

Browse files
committed
chore: fixed client tests
1 parent 20f6bc7 commit 056c868

2 files changed

Lines changed: 3 additions & 13 deletions

File tree

packages/client/lib/AuthorizationDetailsBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class AuthorizationDetailsBuilder {
99
private readonly authorizationDetails: Partial<Exclude<AuthorizationDetailsV1_0_15, string>>
1010

1111
constructor() {
12-
this.authorizationDetails = {}
12+
this.authorizationDetails = { type: 'openid_credential' }
1313
}
1414

1515
withFormats(format: OID4VCICredentialFormat): AuthorizationDetailsBuilder {

packages/client/lib/__tests__/AuthorizationDetailsBuilder.spec.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ describe('AuthorizationDetailsBuilder test', () => {
88
const actual = new AuthorizationDetailsBuilder()
99
.withFormats('jwt_vc' as OID4VCICredentialFormat)
1010
.withLocations(['test1', 'test2'])
11-
.withType('openid_credential')
1211
.buildJwtVcJson()
1312
expect(actual).toEqual({
1413
type: 'openid_credential',
@@ -20,7 +19,6 @@ describe('AuthorizationDetailsBuilder test', () => {
2019
const actual = new AuthorizationDetailsBuilder()
2120
.withFormats('jwt_vc' as OID4VCICredentialFormat)
2221
.withLocations(['test1'])
23-
.withType('openid_credential')
2422
.buildJwtVcJson()
2523
expect(actual).toEqual({
2624
type: 'openid_credential',
@@ -31,24 +29,16 @@ describe('AuthorizationDetailsBuilder test', () => {
3129
it('should create AuthorizationDetails object if locations is missing', () => {
3230
const actual = new AuthorizationDetailsBuilder()
3331
.withFormats('jwt_vc' as OID4VCICredentialFormat)
34-
.withType('openid_credential')
3532
.buildJwtVcJson()
3633
expect(actual).toEqual({
3734
type: 'openid_credential',
3835
format: 'jwt_vc',
3936
})
4037
})
41-
it('should fail if type is missing', () => {
42-
expect(() => {
43-
new AuthorizationDetailsBuilder()
44-
.withFormats('jwt_vc' as OID4VCICredentialFormat)
45-
.withLocations(['test1'])
46-
.buildJwtVcJson()
47-
}).toThrow(Error('Type and format are required properties'))
48-
})
38+
4939
it('should fail if format is missing', () => {
5040
expect(() => {
51-
new AuthorizationDetailsBuilder().withType('openid_credential').withLocations(['test1']).buildJwtVcJson()
41+
new AuthorizationDetailsBuilder().withLocations(['test1']).buildJwtVcJson()
5242
}).toThrow(Error('Type and format are required properties'))
5343
})
5444
})

0 commit comments

Comments
 (0)