@@ -16,7 +16,8 @@ describe('PingOneProtectInitializeCallback', () => {
1616 it ( 'should exist' , ( ) => {
1717 expect ( PingOneProtectInitializeCallback ) . toBeDefined ( ) ;
1818 } ) ;
19- it ( 'should test the getConfig method' , ( ) => {
19+
20+ it ( 'should test the getConfig method with no "agent" parameters' , ( ) => {
2021 const callback = new PingOneProtectInitializeCallback ( {
2122 type : 'PingOneProtectInitializeCallback' as CallbackType ,
2223 input : [
@@ -70,6 +71,10 @@ describe('PingOneProtectInitializeCallback', () => {
7071 name : 'disableHub' ,
7172 value : false ,
7273 } ,
74+ {
75+ name : 'universalDeviceIdentification' ,
76+ value : false ,
77+ } ,
7378 ] ,
7479 } ) ;
7580 const mock = vi . spyOn ( callback , 'getConfig' ) ;
@@ -88,6 +93,99 @@ describe('PingOneProtectInitializeCallback', () => {
8893 disableHub : false ,
8994 } ) ;
9095 } ) ;
96+
97+ it ( 'should test the getConfig method with "agent" parameters' , ( ) => {
98+ const callback = new PingOneProtectInitializeCallback ( {
99+ type : 'PingOneProtectInitializeCallback' as CallbackType ,
100+ input : [
101+ {
102+ name : 'IDToken1signals' ,
103+ value : '' ,
104+ } ,
105+ {
106+ name : 'IDToken1clientError' ,
107+ value : '' ,
108+ } ,
109+ ] ,
110+ output : [
111+ {
112+ name : 'agentIdentification' ,
113+ value : true ,
114+ } ,
115+ {
116+ name : 'agentTimeout' ,
117+ value : 1 ,
118+ } ,
119+ {
120+ name : 'agentPort' ,
121+ value : 1 ,
122+ } ,
123+ {
124+ name : 'envId' ,
125+ value : '02fb4743-189a-4bc7-9d6c-a919edfe6447' ,
126+ } ,
127+ {
128+ name : 'consoleLogEnabled' ,
129+ value : false ,
130+ } ,
131+ {
132+ name : 'deviceAttributesToIgnore' ,
133+ value : [ ] ,
134+ } ,
135+ {
136+ name : 'customHost' ,
137+ value : '' ,
138+ } ,
139+ {
140+ name : 'lazyMetadata' ,
141+ value : false ,
142+ } ,
143+ {
144+ name : 'behavioralDataCollection' ,
145+ value : true ,
146+ } ,
147+ {
148+ name : 'deviceKeyRsyncIntervals' ,
149+ value : 14 ,
150+ } ,
151+ {
152+ name : 'enableTrust' ,
153+ value : false ,
154+ } ,
155+ {
156+ name : 'disableTags' ,
157+ value : false ,
158+ } ,
159+ {
160+ name : 'disableHub' ,
161+ value : false ,
162+ } ,
163+ {
164+ name : 'universalDeviceIdentification' ,
165+ value : false ,
166+ } ,
167+ ] ,
168+ } ) ;
169+ const mock = vi . spyOn ( callback , 'getConfig' ) ;
170+ const config = callback . getConfig ( ) ;
171+ expect ( mock ) . toHaveBeenCalled ( ) ;
172+ expect ( config ) . toMatchObject ( {
173+ agentIdentification : true ,
174+ agentTimeout : 1 ,
175+ agentPort : 1 ,
176+ envId : '02fb4743-189a-4bc7-9d6c-a919edfe6447' ,
177+ consoleLogEnabled : false ,
178+ deviceAttributesToIgnore : [ ] ,
179+ customHost : '' ,
180+ lazyMetadata : false ,
181+ behavioralDataCollection : true ,
182+ deviceKeyRsyncIntervals : 14 ,
183+ enableTrust : false ,
184+ disableTags : false ,
185+ disableHub : false ,
186+ } ) ;
187+ } ) ;
188+
91189 it ( 'should test the setClientError method' , ( ) => {
92190 const callback = new PingOneProtectInitializeCallback ( {
93191 type : 'PingOneProtectInitializeCallback' as CallbackType ,
@@ -102,6 +200,18 @@ describe('PingOneProtectInitializeCallback', () => {
102200 } ,
103201 ] ,
104202 output : [
203+ {
204+ name : 'agentIdentification' ,
205+ value : false ,
206+ } ,
207+ {
208+ name : 'agentTimeout' ,
209+ value : 0 ,
210+ } ,
211+ {
212+ name : 'agentPort' ,
213+ value : 0 ,
214+ } ,
105215 {
106216 name : 'envId' ,
107217 value : '02fb4743-189a-4bc7-9d6c-a919edfe6447' ,
@@ -142,11 +252,15 @@ describe('PingOneProtectInitializeCallback', () => {
142252 name : 'disableHub' ,
143253 value : false ,
144254 } ,
255+ {
256+ name : 'universalDeviceIdentification' ,
257+ value : false ,
258+ } ,
145259 ] ,
146260 } ) ;
147261 const mock = vi . spyOn ( callback , 'setClientError' ) ;
148- callback . setClientError ( 'error i just set' ) ;
262+ callback . setClientError ( 'Error I set' ) ;
149263 expect ( mock ) . toHaveBeenCalled ( ) ;
150- expect ( callback . getInputValue ( 'IDToken1clientError' ) ) . toBe ( 'error i just set' ) ;
264+ expect ( callback . getInputValue ( 'IDToken1clientError' ) ) . toBe ( 'Error I set' ) ;
151265 } ) ;
152266} ) ;
0 commit comments