@@ -16,7 +16,85 @@ 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' , ( ) => {
21+ const callback = new PingOneProtectInitializeCallback ( {
22+ type : 'PingOneProtectInitializeCallback' as CallbackType ,
23+ input : [
24+ {
25+ name : 'IDToken1signals' ,
26+ value : '' ,
27+ } ,
28+ {
29+ name : 'IDToken1clientError' ,
30+ value : '' ,
31+ } ,
32+ ] ,
33+ output : [
34+ {
35+ name : 'envId' ,
36+ value : '02fb4743-189a-4bc7-9d6c-a919edfe6447' ,
37+ } ,
38+ {
39+ name : 'consoleLogEnabled' ,
40+ value : false ,
41+ } ,
42+ {
43+ name : 'deviceAttributesToIgnore' ,
44+ value : [ ] ,
45+ } ,
46+ {
47+ name : 'customHost' ,
48+ value : '' ,
49+ } ,
50+ {
51+ name : 'lazyMetadata' ,
52+ value : false ,
53+ } ,
54+ {
55+ name : 'behavioralDataCollection' ,
56+ value : true ,
57+ } ,
58+ {
59+ name : 'deviceKeyRsyncIntervals' ,
60+ value : 14 ,
61+ } ,
62+ {
63+ name : 'enableTrust' ,
64+ value : false ,
65+ } ,
66+ {
67+ name : 'disableTags' ,
68+ value : false ,
69+ } ,
70+ {
71+ name : 'disableHub' ,
72+ value : false ,
73+ } ,
74+ {
75+ name : 'universalDeviceIdentification' ,
76+ value : false ,
77+ } ,
78+ ] ,
79+ } ) ;
80+ const mock = vi . spyOn ( callback , 'getConfig' ) ;
81+ const config = callback . getConfig ( ) ;
82+ expect ( mock ) . toHaveBeenCalled ( ) ;
83+ expect ( config ) . toMatchObject ( {
84+ envId : '02fb4743-189a-4bc7-9d6c-a919edfe6447' ,
85+ consoleLogEnabled : false ,
86+ deviceAttributesToIgnore : [ ] ,
87+ customHost : '' ,
88+ lazyMetadata : false ,
89+ behavioralDataCollection : true ,
90+ deviceKeyRsyncIntervals : 14 ,
91+ enableTrust : false ,
92+ disableTags : false ,
93+ disableHub : false ,
94+ } ) ;
95+ } ) ;
96+
97+ it ( 'should test the getConfig method with "agent" parameters' , ( ) => {
2098 const callback = new PingOneProtectInitializeCallback ( {
2199 type : 'PingOneProtectInitializeCallback' as CallbackType ,
22100 input : [
@@ -107,6 +185,7 @@ describe('PingOneProtectInitializeCallback', () => {
107185 disableHub : false ,
108186 } ) ;
109187 } ) ;
188+
110189 it ( 'should test the setClientError method' , ( ) => {
111190 const callback = new PingOneProtectInitializeCallback ( {
112191 type : 'PingOneProtectInitializeCallback' as CallbackType ,
0 commit comments