@velocitycareerlabs/server-webwallet 1.25.0-dev-build.1dc2525a2 → 1.25.0-dev-build.129b79772

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.1dc2525a2",
3
+ "version": "1.25.0-dev-build.129b79772",
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.1dc2525a2",
32
- "@velocitycareerlabs/common-functions": "1.25.0-dev-build.1dc2525a2",
33
- "@velocitycareerlabs/common-schemas": "1.25.0-dev-build.1dc2525a2",
34
- "@velocitycareerlabs/config": "1.25.0-dev-build.1dc2525a2",
35
- "@velocitycareerlabs/fastify-plugins": "1.25.0-dev-build.1dc2525a2",
36
- "@velocitycareerlabs/jwt": "1.25.0-dev-build.1dc2525a2",
37
- "@velocitycareerlabs/migrations": "1.25.0-dev-build.1dc2525a2",
38
- "@velocitycareerlabs/request": "1.25.0-dev-build.1dc2525a2",
39
- "@velocitycareerlabs/server-provider": "1.25.0-dev-build.1dc2525a2",
40
- "@velocitycareerlabs/vc-checks": "1.25.0-dev-build.1dc2525a2",
41
- "@velocitycareerlabs/vnf-nodejs-wallet-sdk": "1.25.0-dev-build.1dc2525a2",
31
+ "@velocitycareerlabs/auth": "1.25.0-dev-build.129b79772",
32
+ "@velocitycareerlabs/common-functions": "1.25.0-dev-build.129b79772",
33
+ "@velocitycareerlabs/common-schemas": "1.25.0-dev-build.129b79772",
34
+ "@velocitycareerlabs/config": "1.25.0-dev-build.129b79772",
35
+ "@velocitycareerlabs/fastify-plugins": "1.25.0-dev-build.129b79772",
36
+ "@velocitycareerlabs/jwt": "1.25.0-dev-build.129b79772",
37
+ "@velocitycareerlabs/migrations": "1.25.0-dev-build.129b79772",
38
+ "@velocitycareerlabs/request": "1.25.0-dev-build.129b79772",
39
+ "@velocitycareerlabs/server-provider": "1.25.0-dev-build.129b79772",
40
+ "@velocitycareerlabs/vc-checks": "1.25.0-dev-build.129b79772",
41
+ "@velocitycareerlabs/vnf-nodejs-wallet-sdk": "1.25.0-dev-build.129b79772",
42
42
  "blueimp-md5": "2.19.0",
43
43
  "env-var": "^7.0.0",
44
44
  "fastify": "4.29.0",
@@ -51,14 +51,14 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@spencejs/spence-factories": "0.10.2",
54
- "@velocitycareerlabs/crypto": "1.25.0-dev-build.1dc2525a2",
55
- "@velocitycareerlabs/tests-helpers": "1.25.0-dev-build.1dc2525a2",
54
+ "@velocitycareerlabs/crypto": "1.25.0-dev-build.129b79772",
55
+ "@velocitycareerlabs/tests-helpers": "1.25.0-dev-build.129b79772",
56
56
  "dotenv": "16.4.7",
57
57
  "eslint": "8.57.1",
58
58
  "eslint-config-airbnb-base": "14.2.1",
59
59
  "eslint-config-prettier": "8.10.0",
60
60
  "eslint-plugin-autofix": "1.1.0",
61
- "eslint-plugin-better-mutation": "1.6.0",
61
+ "eslint-plugin-better-mutation": "1.7.0",
62
62
  "eslint-plugin-import": "2.31.0",
63
63
  "eslint-plugin-prefer-arrow-functions": "3.6.2",
64
64
  "eslint-plugin-prettier": "4.2.1",
@@ -68,5 +68,5 @@
68
68
  "nodemon": "3.1.9",
69
69
  "prettier": "2.8.8"
70
70
  },
71
- "gitHead": "ab707d5fd7b5a1ed27e6c0e1725df5276e24720d"
71
+ "gitHead": "24e6e7df9f53c4a5511f50030af529fa1dbd24f3"
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({