@velocitycareerlabs/server-webwallet 1.25.0-dev-build.1c13944a5 → 1.25.0-dev-build.18087857a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velocitycareerlabs/server-webwallet",
3
- "version": "1.25.0-dev-build.1c13944a5",
3
+ "version": "1.25.0-dev-build.18087857a",
4
4
  "description": "Web Wallet application",
5
5
  "repository": "https://github.com/velocitycareerlabs/packages",
6
6
  "engines": {
@@ -28,17 +28,17 @@
28
28
  "@fastify/autoload": "5.10.0",
29
29
  "@fastify/multipart": "~8.3.1",
30
30
  "@spencejs/spence-mongo-repos": "^0.10.2",
31
- "@velocitycareerlabs/auth": "1.25.0-dev-build.1c13944a5",
32
- "@velocitycareerlabs/common-functions": "1.25.0-dev-build.1c13944a5",
33
- "@velocitycareerlabs/common-schemas": "1.25.0-dev-build.1c13944a5",
34
- "@velocitycareerlabs/config": "1.25.0-dev-build.1c13944a5",
35
- "@velocitycareerlabs/fastify-plugins": "1.25.0-dev-build.1c13944a5",
36
- "@velocitycareerlabs/jwt": "1.25.0-dev-build.1c13944a5",
37
- "@velocitycareerlabs/migrations": "1.25.0-dev-build.1c13944a5",
38
- "@velocitycareerlabs/request": "1.25.0-dev-build.1c13944a5",
39
- "@velocitycareerlabs/server-provider": "1.25.0-dev-build.1c13944a5",
40
- "@velocitycareerlabs/vc-checks": "1.25.0-dev-build.1c13944a5",
41
- "@velocitycareerlabs/vnf-nodejs-wallet-sdk": "1.25.0-dev-build.1c13944a5",
31
+ "@velocitycareerlabs/auth": "1.25.0-dev-build.18087857a",
32
+ "@velocitycareerlabs/common-functions": "1.25.0-dev-build.18087857a",
33
+ "@velocitycareerlabs/common-schemas": "1.25.0-dev-build.18087857a",
34
+ "@velocitycareerlabs/config": "1.25.0-dev-build.18087857a",
35
+ "@velocitycareerlabs/fastify-plugins": "1.25.0-dev-build.18087857a",
36
+ "@velocitycareerlabs/jwt": "1.25.0-dev-build.18087857a",
37
+ "@velocitycareerlabs/migrations": "1.25.0-dev-build.18087857a",
38
+ "@velocitycareerlabs/request": "1.25.0-dev-build.18087857a",
39
+ "@velocitycareerlabs/server-provider": "1.25.0-dev-build.18087857a",
40
+ "@velocitycareerlabs/vc-checks": "1.25.0-dev-build.18087857a",
41
+ "@velocitycareerlabs/vnf-nodejs-wallet-sdk": "1.25.0-dev-build.18087857a",
42
42
  "blueimp-md5": "2.19.0",
43
43
  "env-var": "^7.0.0",
44
44
  "fastify": "4.29.0",
@@ -51,8 +51,8 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@spencejs/spence-factories": "0.10.2",
54
- "@velocitycareerlabs/crypto": "1.25.0-dev-build.1c13944a5",
55
- "@velocitycareerlabs/tests-helpers": "1.25.0-dev-build.1c13944a5",
54
+ "@velocitycareerlabs/crypto": "1.25.0-dev-build.18087857a",
55
+ "@velocitycareerlabs/tests-helpers": "1.25.0-dev-build.18087857a",
56
56
  "dotenv": "16.4.7",
57
57
  "eslint": "8.57.1",
58
58
  "eslint-config-airbnb-base": "14.2.1",
@@ -68,5 +68,5 @@
68
68
  "nodemon": "3.1.9",
69
69
  "prettier": "2.8.8"
70
70
  },
71
- "gitHead": "776d027fb801a7b10014187d4e05b958f576199c"
71
+ "gitHead": "b9342eda6ea3684820eca2f60e796452e62f6cd1"
72
72
  }
@@ -89,8 +89,8 @@ describe('Test credentials controller', () => {
89
89
 
90
90
  expect(response.statusCode).toBe(200);
91
91
 
92
- expect(vclSdk.searchForOrganizations).toBeCalledTimes(1);
93
- expect(vclSdk.searchForOrganizations).toBeCalledWith(
92
+ expect(vclSdk.searchForOrganizations).toHaveBeenCalledTimes(1);
93
+ expect(vclSdk.searchForOrganizations).toHaveBeenCalledWith(
94
94
  new VCLOrganizationsSearchDescriptor(
95
95
  new VCLFilter(currentUserCredential.issuer.id)
96
96
  )
@@ -113,6 +113,33 @@ describe('Test credentials controller', () => {
113
113
  });
114
114
  });
115
115
 
116
+ it('should return an error if no display-descriptor', async () => {
117
+ await Promise.all([
118
+ persistCredentials(),
119
+ persistCredentials({
120
+ auth0UserId: 'testUserId2',
121
+ did: 'did:test:2',
122
+ }),
123
+ ]);
124
+
125
+ mock.method(global, 'fetch', () => mockFetch(500, mockSchema));
126
+ const response = await fastify.injectJson({
127
+ method: 'GET',
128
+ url: '/credentials',
129
+ headers: {
130
+ authorization: `Bearer ${auth0Token}`,
131
+ },
132
+ });
133
+
134
+ expect(response.statusCode).toBe(500);
135
+ expect(response.json.errorCode).toBe('web_wallet_server_error');
136
+ expect(response.json.message).toBe(
137
+ 'Failed to fetch descriptor from http://lib.localhost.test/display-descriptors/open-badge-v2.0.descriptor.json'
138
+ );
139
+
140
+ expect(global.fetch.mock.calls).toHaveLength(1);
141
+ });
142
+
116
143
  it('should return empty array of credentials if there are no items in DB for user Id', async () => {
117
144
  await Promise.all([
118
145
  persistCredentials({
@@ -106,7 +106,6 @@ const getOrganizationMock = {
106
106
  ],
107
107
  createdAt: '2022-01-31T12:31:15.493Z',
108
108
  updatedAt: '2023-02-13T13:43:59.317Z',
109
- supportsSecureMessages: false,
110
109
  },
111
110
  TAG: 'VCLOrganization',
112
111
  },
@@ -114,7 +114,6 @@ const mockIssuers = {
114
114
  permittedVelocityServiceCategory: ['Issuer', 'Inspector'],
115
115
  createdAt: '2022-03-01T10:17:38.542Z',
116
116
  updatedAt: '2023-06-26T13:36:05.180Z',
117
- supportsSecureMessages: false,
118
117
  },
119
118
  TAG: 'VCLOrganization',
120
119
  },
@@ -76,7 +76,6 @@ const mockIssuers = {
76
76
  permittedVelocityServiceCategory: ['Issuer', 'Inspector'],
77
77
  createdAt: '2022-03-01T10:17:38.542Z',
78
78
  updatedAt: '2023-06-26T13:36:05.180Z',
79
- supportsSecureMessages: false,
80
79
  },
81
80
  TAG: 'VCLOrganization',
82
81
  },