-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STRATCONN-4169 | Events to Klaviyo destination is failing for delivery (
#2407) * STRATCONN-4169 | Events to Klaviyo destination is failing for delivery * used dayjs library to convert the timestamp to ISO String * Updated unit test case --------- Co-authored-by: Gaurav Kochar <[email protected]>
- Loading branch information
1 parent
504702a
commit 3fefc02
Showing
6 changed files
with
233 additions
and
4 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...ctions/src/destinations/klaviyo/orderCompleted/__tests__/__snapshots__/index.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Order Completed should not pass time property in API when it is not mapped 1`] = `"{\\"data\\":{\\"type\\":\\"event\\",\\"attributes\\":{\\"properties\\":{\\"key\\":\\"value\\"},\\"value\\":10,\\"metric\\":{\\"data\\":{\\"type\\":\\"metric\\",\\"attributes\\":{\\"name\\":\\"Order Completed\\"}}},\\"profile\\":{\\"data\\":{\\"type\\":\\"profile\\",\\"attributes\\":{\\"anonymous_id\\":\\"an0nym0u51d\\"}}}}}}"`; | ||
|
||
exports[`Order Completed should not throw an error when the time property has more than three digits in the milliseconds and should convert the time to ISO format. 1`] = `"{\\"data\\":{\\"type\\":\\"event\\",\\"attributes\\":{\\"properties\\":{\\"key\\":\\"value\\"},\\"time\\":\\"2024-07-22T20:08:49.891Z\\",\\"value\\":10,\\"metric\\":{\\"data\\":{\\"type\\":\\"metric\\",\\"attributes\\":{\\"name\\":\\"Order Completed\\"}}},\\"profile\\":{\\"data\\":{\\"type\\":\\"profile\\",\\"attributes\\":{\\"anonymous_id\\":\\"an0nym0u51d\\"}}}}}}"`; | ||
|
||
exports[`Order Completed should successfully convert the timestamp for the time property to ISO format. 1`] = `"{\\"data\\":{\\"type\\":\\"event\\",\\"attributes\\":{\\"properties\\":{\\"key\\":\\"value\\"},\\"time\\":\\"2024-07-22T20:08:49.890Z\\",\\"value\\":10,\\"metric\\":{\\"data\\":{\\"type\\":\\"metric\\",\\"attributes\\":{\\"name\\":\\"Order Completed\\"}}},\\"profile\\":{\\"data\\":{\\"type\\":\\"profile\\",\\"attributes\\":{\\"anonymous_id\\":\\"an0nym0u51d\\"}}}}}}"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...on-actions/src/destinations/klaviyo/trackEvent/__tests__/__snapshots__/index.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Track Event should not pass time property in API when it is not mapped or defined 1`] = `"{\\"data\\":{\\"type\\":\\"event\\",\\"attributes\\":{\\"properties\\":{\\"key\\":\\"value\\"},\\"value\\":10,\\"unique_id\\":\\"text-example-xyz\\",\\"metric\\":{\\"data\\":{\\"type\\":\\"metric\\",\\"attributes\\":{\\"name\\":\\"event_name\\"}}},\\"profile\\":{\\"data\\":{\\"type\\":\\"profile\\",\\"attributes\\":{\\"anonymous_id\\":\\"an0nym0u51d\\"}}}}}}"`; | ||
|
||
exports[`Track Event should not throw an error when the time property has more than three digits in the milliseconds and should convert the time to ISO format. 1`] = `"{\\"data\\":{\\"type\\":\\"event\\",\\"attributes\\":{\\"properties\\":{\\"key\\":\\"value\\"},\\"time\\":\\"2024-09-11T20:08:49.891Z\\",\\"value\\":10,\\"unique_id\\":\\"text-example-xyz\\",\\"metric\\":{\\"data\\":{\\"type\\":\\"metric\\",\\"attributes\\":{\\"name\\":\\"event_name\\"}}},\\"profile\\":{\\"data\\":{\\"type\\":\\"profile\\",\\"attributes\\":{\\"anonymous_id\\":\\"an0nym0u51d\\"}}}}}}"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters