@connectid-tools/idp-selector-react 6.10.0-alpha.9 → 6.11.0-alpha.1

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.
@@ -1,427 +1,427 @@
1
- import assert from 'node:assert';
2
- import { describe, it } from 'node:test';
3
- import { filterAuthorisationServerByClaims, filterAuthorisationServerByDevice, filterAuthorisationServers, getManualAuthorisationServer, hasCertification, removeExpiredOrNotStartedCertifications, } from './certification';
4
- describe('filterAuthorisationServers', () => {
5
- it('should return all authorisation servers if showAllParticipants is true regardless of certification status, required certifications and claims', () => {
1
+ import assert from "node:assert";
2
+ import { describe, it } from "node:test";
3
+ import { filterAuthorisationServerByClaims, filterAuthorisationServerByDevice, filterAuthorisationServers, getManualAuthorisationServer, hasCertification, removeExpiredOrNotStartedCertifications, } from "./certification.js";
4
+ describe("filterAuthorisationServers", () => {
5
+ it("should return all authorisation servers if showAllParticipants is true regardless of certification status, required certifications and claims", () => {
6
6
  const authorisationServers = [
7
7
  // no certifications at all
8
8
  {
9
- AuthorisationServerId: '71fe3927-f596-4192-ab9a-f6644cdb9b21',
10
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
11
- CustomerFriendlyName: 'Mock Bank B',
9
+ AuthorisationServerId: "71fe3927-f596-4192-ab9a-f6644cdb9b21",
10
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
11
+ CustomerFriendlyName: "Mock Bank B",
12
12
  AuthorisationServerCertifications: [],
13
13
  },
14
14
  ];
15
- assert.deepStrictEqual(filterAuthorisationServers(authorisationServers, true, 'Active', ['email'], ['TDIF.IDP']), authorisationServers);
15
+ assert.deepStrictEqual(filterAuthorisationServers(authorisationServers, true, "Active", ["email"], ["TDIF.IDP"]), authorisationServers);
16
16
  });
17
- it('should filter authorisation servers if showAllParticipants is false', () => {
18
- Object.defineProperty(global, 'navigator', { value: { userAgent: 'xxxdesktop' }, configurable: true });
17
+ it("should filter authorisation servers if showAllParticipants is false", () => {
18
+ Object.defineProperty(global, "navigator", { value: { userAgent: "xxxdesktop" }, configurable: true });
19
19
  const authorisationServers = [
20
20
  // no certifications at all
21
21
  {
22
- AuthorisationServerId: '71fe3927-f596-4192-ab9a-f6644cdb9b21',
23
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
24
- CustomerFriendlyName: 'Mock Bank B',
22
+ AuthorisationServerId: "71fe3927-f596-4192-ab9a-f6644cdb9b21",
23
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
24
+ CustomerFriendlyName: "Mock Bank B",
25
25
  AuthorisationServerCertifications: [],
26
26
  },
27
27
  // expired
28
28
  {
29
- AuthorisationServerId: '71fe3927-f596-4192-ab9a-f6644cdb9b22',
30
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
31
- CustomerFriendlyName: 'Mock Bank C',
29
+ AuthorisationServerId: "71fe3927-f596-4192-ab9a-f6644cdb9b22",
30
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
31
+ CustomerFriendlyName: "Mock Bank C",
32
32
  AuthorisationServerCertifications: [
33
33
  {
34
- CertificationStartDate: '10/04/1900',
35
- CertificationExpirationDate: '10/04/2000',
36
- Status: 'Certified',
37
- ProfileVariant: 'FAPI2 Adv. OP w/Private Key, PAR',
38
- ProfileType: 'Redirect',
34
+ CertificationStartDate: "10/04/1900",
35
+ CertificationExpirationDate: "10/04/2000",
36
+ Status: "Certified",
37
+ ProfileVariant: "FAPI2 Adv. OP w/Private Key, PAR",
38
+ ProfileType: "Redirect",
39
39
  },
40
40
  ],
41
41
  },
42
42
  // fapi2, web and email claim
43
43
  {
44
- AuthorisationServerId: '71fe3927-f596-4192-ab9a-f6644cdb9b23',
45
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
46
- CustomerFriendlyName: 'Mock Bank D',
44
+ AuthorisationServerId: "71fe3927-f596-4192-ab9a-f6644cdb9b23",
45
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
46
+ CustomerFriendlyName: "Mock Bank D",
47
47
  AuthorisationServerCertifications: [
48
48
  {
49
- CertificationStartDate: '10/04/1900',
50
- CertificationExpirationDate: '10/04/2099',
51
- Status: 'Certified',
52
- ProfileVariant: 'FAPI2 Adv. OP w/Private Key, PAR',
53
- ProfileType: 'Redirect',
49
+ CertificationStartDate: "10/04/1900",
50
+ CertificationExpirationDate: "10/04/2099",
51
+ Status: "Certified",
52
+ ProfileVariant: "FAPI2 Adv. OP w/Private Key, PAR",
53
+ ProfileType: "Redirect",
54
54
  },
55
55
  {
56
- CertificationStartDate: '10/04/1900',
57
- CertificationExpirationDate: '10/04/2099',
58
- Status: 'Certified',
59
- ProfileVariant: 'web',
60
- ProfileType: 'Channel',
56
+ CertificationStartDate: "10/04/1900",
57
+ CertificationExpirationDate: "10/04/2099",
58
+ Status: "Certified",
59
+ ProfileVariant: "web",
60
+ ProfileType: "Channel",
61
61
  },
62
62
  {
63
- CertificationStartDate: '10/04/1900',
64
- CertificationExpirationDate: '10/04/2099',
65
- Status: 'Certified',
66
- ProfileVariant: 'email',
67
- ProfileType: 'ConnectID Claims',
63
+ CertificationStartDate: "10/04/1900",
64
+ CertificationExpirationDate: "10/04/2099",
65
+ Status: "Certified",
66
+ ProfileVariant: "email",
67
+ ProfileType: "ConnectID Claims",
68
68
  },
69
69
  ],
70
70
  },
71
71
  // fapi2, web and birthdate claim
72
72
  {
73
- AuthorisationServerId: '71fe3927-f596-4192-ab9a-f6644cdb9b24',
74
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
75
- CustomerFriendlyName: 'Mock Bank E',
73
+ AuthorisationServerId: "71fe3927-f596-4192-ab9a-f6644cdb9b24",
74
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
75
+ CustomerFriendlyName: "Mock Bank E",
76
76
  AuthorisationServerCertifications: [
77
77
  {
78
- CertificationStartDate: '10/04/1900',
79
- CertificationExpirationDate: '10/04/2099',
80
- Status: 'Certified',
81
- ProfileVariant: 'FAPI2 Adv. OP w/Private Key, PAR',
82
- ProfileType: 'Redirect',
78
+ CertificationStartDate: "10/04/1900",
79
+ CertificationExpirationDate: "10/04/2099",
80
+ Status: "Certified",
81
+ ProfileVariant: "FAPI2 Adv. OP w/Private Key, PAR",
82
+ ProfileType: "Redirect",
83
83
  },
84
84
  {
85
- CertificationStartDate: '10/04/1900',
86
- CertificationExpirationDate: '10/04/2099',
87
- Status: 'Certified',
88
- ProfileVariant: 'web',
89
- ProfileType: 'Channel',
85
+ CertificationStartDate: "10/04/1900",
86
+ CertificationExpirationDate: "10/04/2099",
87
+ Status: "Certified",
88
+ ProfileVariant: "web",
89
+ ProfileType: "Channel",
90
90
  },
91
91
  {
92
- CertificationStartDate: '10/04/1900',
93
- CertificationExpirationDate: '10/04/2099',
94
- Status: 'Certified',
95
- ProfileVariant: 'birthdate',
96
- ProfileType: 'ConnectID Claims',
92
+ CertificationStartDate: "10/04/1900",
93
+ CertificationExpirationDate: "10/04/2099",
94
+ Status: "Certified",
95
+ ProfileVariant: "birthdate",
96
+ ProfileType: "ConnectID Claims",
97
97
  },
98
98
  ],
99
99
  },
100
100
  ];
101
- assert.deepStrictEqual(filterAuthorisationServers(authorisationServers, false, 'Active', ['email'], ['Redirect.FAPI2']), [authorisationServers[2]]);
101
+ assert.deepStrictEqual(filterAuthorisationServers(authorisationServers, false, "Active", ["email"], ["Redirect.FAPI2"]), [authorisationServers[2]]);
102
102
  });
103
103
  });
104
- describe('getManualAuthorisationServer', () => {
104
+ describe("getManualAuthorisationServer", () => {
105
105
  const authorisationServers = [
106
106
  {
107
- AuthorisationServerId: '71fe3927-f596-4192-ab9a-f6644cdb9b2b',
108
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
109
- CustomerFriendlyName: 'Mock Bank A',
107
+ AuthorisationServerId: "71fe3927-f596-4192-ab9a-f6644cdb9b2b",
108
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
109
+ CustomerFriendlyName: "Mock Bank A",
110
110
  // expired
111
111
  AuthorisationServerCertifications: [
112
112
  {
113
- CertificationExpirationDate: '10/04/2000',
114
- Status: 'Certified',
115
- ProfileVariant: 'Fallback Identity Service Provider',
113
+ CertificationExpirationDate: "10/04/2000",
114
+ Status: "Certified",
115
+ ProfileVariant: "Fallback Identity Service Provider",
116
116
  // @ts-ignore
117
- ProfileType: 'ConnectID',
117
+ ProfileType: "ConnectID",
118
118
  },
119
119
  ],
120
120
  },
121
121
  ];
122
- it('should return expired manual servers if showAllParticipants is true', () => {
122
+ it("should return expired manual servers if showAllParticipants is true", () => {
123
123
  assert.deepStrictEqual(getManualAuthorisationServer(authorisationServers, true), authorisationServers[0]);
124
124
  });
125
- it('should not return expired manual servers if showAllParticipants is false', () => {
125
+ it("should not return expired manual servers if showAllParticipants is false", () => {
126
126
  assert.deepStrictEqual(getManualAuthorisationServer(authorisationServers, false), undefined);
127
127
  });
128
128
  });
129
- describe('filterAuthorisationServerByClaims', () => {
129
+ describe("filterAuthorisationServerByClaims", () => {
130
130
  const authorisationServers = [
131
131
  {
132
- AuthorisationServerId: '1',
133
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
134
- CustomerFriendlyName: 'Mock Bank A',
132
+ AuthorisationServerId: "1",
133
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
134
+ CustomerFriendlyName: "Mock Bank A",
135
135
  AuthorisationServerCertifications: [
136
136
  {
137
- CertificationStartDate: '10/04/1900',
138
- CertificationExpirationDate: '10/04/2099',
139
- Status: 'Certified',
140
- ProfileVariant: 'email',
141
- ProfileType: 'ConnectID Claims',
137
+ CertificationStartDate: "10/04/1900",
138
+ CertificationExpirationDate: "10/04/2099",
139
+ Status: "Certified",
140
+ ProfileVariant: "email",
141
+ ProfileType: "ConnectID Claims",
142
142
  },
143
143
  ],
144
144
  },
145
145
  {
146
- AuthorisationServerId: '2',
147
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
148
- CustomerFriendlyName: 'Mock Bank B',
146
+ AuthorisationServerId: "2",
147
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
148
+ CustomerFriendlyName: "Mock Bank B",
149
149
  // no claims
150
150
  AuthorisationServerCertifications: [],
151
151
  },
152
152
  {
153
- AuthorisationServerId: '3',
154
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
155
- CustomerFriendlyName: 'Mock Bank C',
153
+ AuthorisationServerId: "3",
154
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
155
+ CustomerFriendlyName: "Mock Bank C",
156
156
  AuthorisationServerCertifications: [
157
157
  // multiple claims
158
158
  {
159
- CertificationStartDate: '10/04/1900',
160
- CertificationExpirationDate: '10/04/2099',
161
- Status: 'Certified',
162
- ProfileVariant: 'email',
163
- ProfileType: 'ConnectID Claims',
159
+ CertificationStartDate: "10/04/1900",
160
+ CertificationExpirationDate: "10/04/2099",
161
+ Status: "Certified",
162
+ ProfileVariant: "email",
163
+ ProfileType: "ConnectID Claims",
164
164
  },
165
165
  {
166
- CertificationStartDate: '10/04/1900',
167
- CertificationExpirationDate: '10/04/2099',
168
- Status: 'Certified',
169
- ProfileVariant: 'birthdate',
170
- ProfileType: 'ConnectID Claims',
166
+ CertificationStartDate: "10/04/1900",
167
+ CertificationExpirationDate: "10/04/2099",
168
+ Status: "Certified",
169
+ ProfileVariant: "birthdate",
170
+ ProfileType: "ConnectID Claims",
171
171
  },
172
172
  {
173
- CertificationStartDate: '10/04/1900',
174
- CertificationExpirationDate: '10/04/2099',
175
- Status: 'Certified',
176
- ProfileVariant: 'name',
177
- ProfileType: 'ConnectID Claims',
173
+ CertificationStartDate: "10/04/1900",
174
+ CertificationExpirationDate: "10/04/2099",
175
+ Status: "Certified",
176
+ ProfileVariant: "name",
177
+ ProfileType: "ConnectID Claims",
178
178
  },
179
179
  ],
180
180
  },
181
181
  ];
182
- it('should return no authorisation servers when claim is address', () => {
183
- assert.deepStrictEqual(filterAuthorisationServerByClaims(authorisationServers, ['address']), []);
182
+ it("should return no authorisation servers when claim is address", () => {
183
+ assert.deepStrictEqual(filterAuthorisationServerByClaims(authorisationServers, ["address"]), []);
184
184
  });
185
- it('should return bank C and A when claim email', () => {
186
- assert.deepStrictEqual(filterAuthorisationServerByClaims(authorisationServers, ['email']), [
185
+ it("should return bank C and A when claim email", () => {
186
+ assert.deepStrictEqual(filterAuthorisationServerByClaims(authorisationServers, ["email"]), [
187
187
  authorisationServers[0],
188
188
  authorisationServers[2],
189
189
  ]);
190
190
  });
191
- it('should return bank C when claim is email and birthdate', () => {
192
- assert.deepStrictEqual(filterAuthorisationServerByClaims(authorisationServers, ['email', 'birthdate']), [
191
+ it("should return bank C when claim is email and birthdate", () => {
192
+ assert.deepStrictEqual(filterAuthorisationServerByClaims(authorisationServers, ["email", "birthdate"]), [
193
193
  authorisationServers[2],
194
194
  ]);
195
195
  });
196
- it('should return bank C when claim is given_name, middle_name and birthdate', () => {
197
- assert.deepStrictEqual(filterAuthorisationServerByClaims(authorisationServers, ['given_name', 'middle_name', 'birthdate']), [authorisationServers[2]]);
196
+ it("should return bank C when claim is given_name, middle_name and birthdate", () => {
197
+ assert.deepStrictEqual(filterAuthorisationServerByClaims(authorisationServers, ["given_name", "middle_name", "birthdate"]), [authorisationServers[2]]);
198
198
  });
199
- it('should return bank C when claim is name', () => {
200
- assert.deepStrictEqual(filterAuthorisationServerByClaims(authorisationServers, ['given_name']), [
199
+ it("should return bank C when claim is name", () => {
200
+ assert.deepStrictEqual(filterAuthorisationServerByClaims(authorisationServers, ["given_name"]), [
201
201
  authorisationServers[2],
202
202
  ]);
203
203
  });
204
204
  });
205
- describe('removeExpiredCertifications', () => {
206
- it('should remove expired or not started certifications', () => {
205
+ describe("removeExpiredCertifications", () => {
206
+ it("should remove expired or not started certifications", () => {
207
207
  const authorisationServers = [
208
208
  {
209
- AuthorisationServerId: '1',
210
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
211
- CustomerFriendlyName: 'Mock Bank A',
209
+ AuthorisationServerId: "1",
210
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
211
+ CustomerFriendlyName: "Mock Bank A",
212
212
  AuthorisationServerCertifications: [
213
213
  // certified and not expired
214
214
  {
215
- CertificationStartDate: '10/04/1900',
216
- CertificationExpirationDate: '10/04/2099',
217
- Status: 'Certified',
218
- ProfileVariant: 'web',
219
- ProfileType: 'Channel',
215
+ CertificationStartDate: "10/04/1900",
216
+ CertificationExpirationDate: "10/04/2099",
217
+ Status: "Certified",
218
+ ProfileVariant: "web",
219
+ ProfileType: "Channel",
220
220
  },
221
221
  // not certified and not expired
222
222
  {
223
- CertificationStartDate: '10/04/1900',
224
- CertificationExpirationDate: '10/04/2099',
225
- Status: 'Deprecated',
226
- ProfileVariant: 'FAPI2 Adv. OP w/Private Key, PAR',
227
- ProfileType: 'Redirect',
223
+ CertificationStartDate: "10/04/1900",
224
+ CertificationExpirationDate: "10/04/2099",
225
+ Status: "Deprecated",
226
+ ProfileVariant: "FAPI2 Adv. OP w/Private Key, PAR",
227
+ ProfileType: "Redirect",
228
228
  },
229
229
  ],
230
230
  },
231
231
  {
232
- AuthorisationServerId: '2',
233
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
234
- CustomerFriendlyName: 'Mock Bank B',
232
+ AuthorisationServerId: "2",
233
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
234
+ CustomerFriendlyName: "Mock Bank B",
235
235
  // no certifications
236
236
  AuthorisationServerCertifications: [],
237
237
  },
238
238
  {
239
- AuthorisationServerId: '3',
240
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
241
- CustomerFriendlyName: 'Mock Bank C',
239
+ AuthorisationServerId: "3",
240
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
241
+ CustomerFriendlyName: "Mock Bank C",
242
242
  AuthorisationServerCertifications: [
243
243
  // certified but expired
244
244
  {
245
- CertificationStartDate: '10/04/1900',
246
- CertificationExpirationDate: '10/04/2000',
247
- Status: 'Certified',
248
- ProfileVariant: 'web',
249
- ProfileType: 'Channel',
245
+ CertificationStartDate: "10/04/1900",
246
+ CertificationExpirationDate: "10/04/2000",
247
+ Status: "Certified",
248
+ ProfileVariant: "web",
249
+ ProfileType: "Channel",
250
250
  },
251
251
  ],
252
252
  },
253
253
  {
254
- AuthorisationServerId: '4',
255
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
256
- CustomerFriendlyName: 'Mock Bank D',
254
+ AuthorisationServerId: "4",
255
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
256
+ CustomerFriendlyName: "Mock Bank D",
257
257
  AuthorisationServerCertifications: [
258
258
  // certified and not expired but not started
259
259
  {
260
- CertificationStartDate: '10/04/2098',
261
- CertificationExpirationDate: '10/04/2099',
262
- Status: 'Certified',
263
- ProfileVariant: 'web',
264
- ProfileType: 'Channel',
260
+ CertificationStartDate: "10/04/2098",
261
+ CertificationExpirationDate: "10/04/2099",
262
+ Status: "Certified",
263
+ ProfileVariant: "web",
264
+ ProfileType: "Channel",
265
265
  },
266
266
  ],
267
267
  },
268
268
  ];
269
269
  const expected = [
270
270
  {
271
- AuthorisationServerId: '1',
272
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
273
- CustomerFriendlyName: 'Mock Bank A',
271
+ AuthorisationServerId: "1",
272
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
273
+ CustomerFriendlyName: "Mock Bank A",
274
274
  AuthorisationServerCertifications: [
275
275
  // certified and not expired
276
276
  {
277
- CertificationStartDate: '10/04/1900',
278
- CertificationExpirationDate: '10/04/2099',
279
- Status: 'Certified',
280
- ProfileVariant: 'web',
281
- ProfileType: 'Channel',
277
+ CertificationStartDate: "10/04/1900",
278
+ CertificationExpirationDate: "10/04/2099",
279
+ Status: "Certified",
280
+ ProfileVariant: "web",
281
+ ProfileType: "Channel",
282
282
  },
283
283
  ],
284
284
  },
285
285
  {
286
- AuthorisationServerId: '2',
287
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
288
- CustomerFriendlyName: 'Mock Bank B',
286
+ AuthorisationServerId: "2",
287
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
288
+ CustomerFriendlyName: "Mock Bank B",
289
289
  // no certifications
290
290
  AuthorisationServerCertifications: [],
291
291
  },
292
292
  {
293
- AuthorisationServerId: '3',
294
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
295
- CustomerFriendlyName: 'Mock Bank C',
293
+ AuthorisationServerId: "3",
294
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
295
+ CustomerFriendlyName: "Mock Bank C",
296
296
  AuthorisationServerCertifications: [],
297
297
  },
298
298
  {
299
- AuthorisationServerId: '4',
300
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
301
- CustomerFriendlyName: 'Mock Bank D',
299
+ AuthorisationServerId: "4",
300
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
301
+ CustomerFriendlyName: "Mock Bank D",
302
302
  AuthorisationServerCertifications: [],
303
303
  },
304
304
  ];
305
305
  assert.deepStrictEqual(removeExpiredOrNotStartedCertifications(authorisationServers), expected);
306
306
  });
307
307
  });
308
- describe('filterAuthorisationServerByDevice', () => {
309
- it('should return all authorisation servers for mobile', () => {
308
+ describe("filterAuthorisationServerByDevice", () => {
309
+ it("should return all authorisation servers for mobile", () => {
310
310
  const authorisationServers = [
311
311
  {
312
- AuthorisationServerId: '1',
313
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
314
- CustomerFriendlyName: 'Mock Bank A',
312
+ AuthorisationServerId: "1",
313
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
314
+ CustomerFriendlyName: "Mock Bank A",
315
315
  AuthorisationServerCertifications: [
316
316
  {
317
- ProfileType: 'Channel',
318
- ProfileVariant: 'app',
319
- CertificationExpirationDate: '10/04/2099',
320
- Status: 'Certified',
321
- CertificationStartDate: '10/04/1900',
317
+ ProfileType: "Channel",
318
+ ProfileVariant: "app",
319
+ CertificationExpirationDate: "10/04/2099",
320
+ Status: "Certified",
321
+ CertificationStartDate: "10/04/1900",
322
322
  },
323
323
  ],
324
324
  },
325
325
  {
326
- AuthorisationServerId: '2',
327
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
328
- CustomerFriendlyName: 'Mock Bank B',
326
+ AuthorisationServerId: "2",
327
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
328
+ CustomerFriendlyName: "Mock Bank B",
329
329
  AuthorisationServerCertifications: [
330
330
  {
331
- ProfileType: 'Channel',
332
- ProfileVariant: 'web',
333
- CertificationExpirationDate: '10/04/2099',
334
- Status: 'Certified',
335
- CertificationStartDate: '10/04/1900',
331
+ ProfileType: "Channel",
332
+ ProfileVariant: "web",
333
+ CertificationExpirationDate: "10/04/2099",
334
+ Status: "Certified",
335
+ CertificationStartDate: "10/04/1900",
336
336
  },
337
337
  ],
338
338
  },
339
339
  ];
340
- assert.deepStrictEqual(filterAuthorisationServerByDevice(authorisationServers, 'mobile'), authorisationServers);
340
+ assert.deepStrictEqual(filterAuthorisationServerByDevice(authorisationServers, "mobile"), authorisationServers);
341
341
  });
342
- it('should return all authorisation servers except those with only app certification when desktop', () => {
342
+ it("should return all authorisation servers except those with only app certification when desktop", () => {
343
343
  const authorisationServers = [
344
344
  {
345
- AuthorisationServerId: '1',
346
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
347
- CustomerFriendlyName: 'Mock Bank A',
345
+ AuthorisationServerId: "1",
346
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
347
+ CustomerFriendlyName: "Mock Bank A",
348
348
  // has only app certification (removed)
349
349
  AuthorisationServerCertifications: [
350
350
  {
351
- ProfileType: 'Channel',
352
- ProfileVariant: 'app',
353
- CertificationExpirationDate: '10/04/2099',
354
- Status: 'Certified',
355
- CertificationStartDate: '10/04/1900',
351
+ ProfileType: "Channel",
352
+ ProfileVariant: "app",
353
+ CertificationExpirationDate: "10/04/2099",
354
+ Status: "Certified",
355
+ CertificationStartDate: "10/04/1900",
356
356
  },
357
357
  ],
358
358
  },
359
359
  {
360
- AuthorisationServerId: '2',
361
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
362
- CustomerFriendlyName: 'Mock Bank B',
360
+ AuthorisationServerId: "2",
361
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
362
+ CustomerFriendlyName: "Mock Bank B",
363
363
  AuthorisationServerCertifications: [
364
364
  {
365
- ProfileType: 'Channel',
366
- ProfileVariant: 'web',
367
- CertificationExpirationDate: '10/04/2099',
368
- Status: 'Certified',
369
- CertificationStartDate: '10/04/1900',
365
+ ProfileType: "Channel",
366
+ ProfileVariant: "web",
367
+ CertificationExpirationDate: "10/04/2099",
368
+ Status: "Certified",
369
+ CertificationStartDate: "10/04/1900",
370
370
  },
371
371
  ],
372
372
  },
373
373
  {
374
- AuthorisationServerId: '3',
375
- CustomerFriendlyLogoUri: 'https://static.sandbox.connectid.com.au/BankA.svg',
376
- CustomerFriendlyName: 'Mock Bank C',
374
+ AuthorisationServerId: "3",
375
+ CustomerFriendlyLogoUri: "https://static.sandbox.connectid.com.au/BankA.svg",
376
+ CustomerFriendlyName: "Mock Bank C",
377
377
  // has web and app certifications (okay)
378
378
  AuthorisationServerCertifications: [
379
379
  {
380
- ProfileType: 'Channel',
381
- ProfileVariant: 'app',
382
- CertificationExpirationDate: '10/04/2099',
383
- Status: 'Certified',
384
- CertificationStartDate: '10/04/1900',
380
+ ProfileType: "Channel",
381
+ ProfileVariant: "app",
382
+ CertificationExpirationDate: "10/04/2099",
383
+ Status: "Certified",
384
+ CertificationStartDate: "10/04/1900",
385
385
  },
386
386
  {
387
- ProfileType: 'Channel',
388
- ProfileVariant: 'web',
389
- CertificationExpirationDate: '10/04/2099',
390
- Status: 'Certified',
391
- CertificationStartDate: '10/04/1900',
387
+ ProfileType: "Channel",
388
+ ProfileVariant: "web",
389
+ CertificationExpirationDate: "10/04/2099",
390
+ Status: "Certified",
391
+ CertificationStartDate: "10/04/1900",
392
392
  },
393
393
  ],
394
394
  },
395
395
  ];
396
- assert.deepStrictEqual(filterAuthorisationServerByDevice(authorisationServers, 'desktop'), [
396
+ assert.deepStrictEqual(filterAuthorisationServerByDevice(authorisationServers, "desktop"), [
397
397
  authorisationServers[1],
398
398
  authorisationServers[2],
399
399
  ]);
400
400
  });
401
401
  });
402
- describe('hasCertification', () => {
403
- it('should return true if certifications have channel app', () => {
402
+ describe("hasCertification", () => {
403
+ it("should return true if certifications have channel app", () => {
404
404
  const certifications = [
405
405
  {
406
- CertificationStartDate: '10/04/1900',
407
- CertificationExpirationDate: '10/04/2099',
408
- Status: 'Certified',
409
- ProfileVariant: 'app',
410
- ProfileType: 'Channel',
406
+ CertificationStartDate: "10/04/1900",
407
+ CertificationExpirationDate: "10/04/2099",
408
+ Status: "Certified",
409
+ ProfileVariant: "app",
410
+ ProfileType: "Channel",
411
411
  },
412
412
  ];
413
- assert.ok(hasCertification(certifications, 'Channel', 'app') === true);
413
+ assert.ok(hasCertification(certifications, "Channel", "app") === true);
414
414
  });
415
- it('should return false if certifications do not have channel app', () => {
415
+ it("should return false if certifications do not have channel app", () => {
416
416
  const certifications = [
417
417
  {
418
- CertificationStartDate: '10/04/1900',
419
- CertificationExpirationDate: '10/04/2099',
420
- Status: 'Certified',
421
- ProfileVariant: 'web',
422
- ProfileType: 'Channel',
418
+ CertificationStartDate: "10/04/1900",
419
+ CertificationExpirationDate: "10/04/2099",
420
+ Status: "Certified",
421
+ ProfileVariant: "web",
422
+ ProfileType: "Channel",
423
423
  },
424
424
  ];
425
- assert.ok(hasCertification(certifications, 'Channel', 'app') === false);
425
+ assert.ok(hasCertification(certifications, "Channel", "app") === false);
426
426
  });
427
427
  });