@@ -39,7 +39,7 @@ describe('trackConversion', () => {
3939 describe ( 'perform' , ( ) => {
4040 it ( 'should send event data successfully' , async ( ) => {
4141 nock ( `${ Region . NA } ` )
42- . post ( '/events /v1' )
42+ . post ( '/adsApi /v1/create/events ' )
4343 . reply ( 200 , { success : true } )
4444
4545 const responses = await testDestination . testAction ( 'trackConversion' , {
@@ -66,7 +66,7 @@ describe('trackConversion', () => {
6666 it ( 'should handle API errors' , async ( ) => {
6767 // Mock an API error response
6868 nock ( `${ Region . NA } ` )
69- . post ( '/events /v1' )
69+ . post ( '/adsApi /v1/create/events ' )
7070 . replyWithError ( 'Invalid event data' )
7171
7272 await expect (
@@ -95,7 +95,7 @@ describe('trackConversion', () => {
9595 settings,
9696 mapping : {
9797 name : 'test_conversion' ,
98- // Missing eventType
98+ // Missing conversionType
9999 eventActionSource : 'website' ,
100100 countryCode : 'US' ,
101101 timestamp : '2023-01-01T12:00:00Z' ,
@@ -130,14 +130,10 @@ describe('trackConversion', () => {
130130 it ( 'should process a batch of events successfully' , async ( ) => {
131131 // Mock a 207 multi-status response
132132 nock ( `${ Region . NA } ` )
133- . post ( '/events /v1' )
133+ . post ( '/adsApi /v1/create/events ' )
134134 . reply ( 207 , {
135- success : [
136- { index : 1 , message : 'Success' }
137- ] ,
138- error : [
139- { index : 2 , httpStatusCode : '400' , subErrors : [ { errorMessage : 'Invalid event' } ] }
140- ]
135+ success : [ { index : 0 , event : null } ] ,
136+ error : [ { index : 1 , errors : [ { code : "BAD_REQUEST" , message : 'Invalid data' } ] } ]
141137 } )
142138
143139 const responses = await testDestination . testBatchAction ( 'trackConversion' , {
@@ -169,9 +165,9 @@ describe('trackConversion', () => {
169165 it ( 'should handle validation errors for individual payloads' , async ( ) => {
170166 // Mock the API request to send a partial success response
171167 nock ( `${ Region . NA } ` )
172- . post ( '/events /v1' )
168+ . post ( '/adsApi /v1/create/events ' )
173169 . reply ( 207 , {
174- success : [ { index : 1 , message : 'Success' } , { index : 2 , message : 'Success' } ] ,
170+ success : [ { index : 0 , event : null } , { index : 1 , event : null } ] ,
175171 error : [ ]
176172 } )
177173
@@ -221,7 +217,7 @@ describe('trackConversion', () => {
221217
222218 it ( 'should handle API errors in batch mode' , async ( ) => {
223219 nock ( `${ Region . NA } ` )
224- . post ( '/events /v1' )
220+ . post ( '/adsApi /v1/create/events ' )
225221 . reply ( 500 , { error : 'Internal server error' } )
226222
227223 // Spy on console.error to prevent error output during the test
0 commit comments