@@ -23,7 +23,7 @@ const configuration: UserGroupGatewayConfig = {
23
23
provider : 'okta' ,
24
24
url : 'http://somedomain/' ,
25
25
clientId : 'clientId' ,
26
- privateKey : 'privateKey ' , // pragma: allowlist secret
26
+ privateKey : '{} ' , // pragma: allowlist secret
27
27
keyId : 'keyId' ,
28
28
} ;
29
29
@@ -48,11 +48,11 @@ describe('OktaGroupGateway', () => {
48
48
}
49
49
} ) ;
50
50
51
- test ( 'unknown error on initialization' , async ( ) => {
52
- // TODO: Must be able to mock the Client class from the Okta SDK
53
- // const testError = 'Test Error';
54
- // await expect(OktaUserGroupGateway.initialize(configuration)).rejects.toThrow(testError);
55
- } ) ;
51
+ // test('unknown error on initialization', async () => {
52
+ // // TODO: Must be able to mock the Client class from the Okta SDK
53
+ // // const testError = 'Test Error';
54
+ // // await expect(OktaUserGroupGateway.initialize(configuration)).rejects.toThrow(testError);
55
+ // });
56
56
} ) ;
57
57
58
58
describe ( 'getUserGroups' , ( ) => {
@@ -112,22 +112,36 @@ describe('OktaGroupGateway', () => {
112
112
name : 'cams group name' ,
113
113
} ;
114
114
115
- const user : User = {
116
-
117
- profile : {
118
- displayName : 'Abe Lincoln' ,
119
- } ,
120
- } ;
121
-
122
115
test ( 'should return a list of CamsUsers' , async ( ) => {
123
- listGroupUsers . mockResolvedValue ( buildMockCollection < User > ( [ user ] ) ) ;
116
+ const user1 : User = {
117
+ id : '00123abc' ,
118
+ profile : {
119
+
120
+ displayName : 'Abe Lincoln' ,
121
+ } ,
122
+ } ;
123
+
124
+ const user2 : User = {
125
+ id : '99123abc' ,
126
+ profile : {
127
+
128
+ firstName : 'Mary' ,
129
+ lastName : 'Lincoln' ,
130
+ } ,
131
+ } ;
132
+
133
+ listGroupUsers . mockResolvedValue ( buildMockCollection < User > ( [ user1 , user2 ] ) ) ;
124
134
125
135
const actual = await OktaUserGroupGateway . getUserGroupUsers ( configuration , camsUserGroup ) ;
126
136
127
137
const expected : CamsUserReference [ ] = [
128
138
{
129
- id : user . id ,
130
- name : user . profile . displayName ,
139
+ id : user1 . profile . login ,
140
+ name : user1 . profile . displayName ,
141
+ } ,
142
+ {
143
+ id : user2 . profile . login ,
144
+ name : user2 . profile . lastName + ', ' + user2 . profile . firstName ,
131
145
} ,
132
146
] ;
133
147
expect ( actual ) . toEqual ( expected ) ;
0 commit comments