-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(analytics|react): update order completed analytics event
- update fields on `order_completed` event contract of GA4 and Omnitracking integration to add new fields.
- Loading branch information
1 parent
aae0757
commit cb1ee2a
Showing
10 changed files
with
205 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import * as getters from '../getters.js'; | ||
|
||
describe('getters', () => { | ||
describe('getCheckoutOrderIdentificationProperties', () => { | ||
it('Should retrieve order data with multiple test cases', () => { | ||
const checkoutOrderId = 123; | ||
|
||
expect( | ||
getters.getCheckoutOrderIdentificationProperties({ | ||
orderId: null, | ||
checkoutOrderId: checkoutOrderId, | ||
}), | ||
).toEqual({ | ||
orderCode: undefined, | ||
orderId: checkoutOrderId, | ||
}); | ||
|
||
expect( | ||
getters.getCheckoutOrderIdentificationProperties({ | ||
orderId: undefined, | ||
checkoutOrderId: checkoutOrderId, | ||
}), | ||
).toEqual({ | ||
orderCode: undefined, | ||
orderId: checkoutOrderId, | ||
}); | ||
|
||
expect( | ||
getters.getCheckoutOrderIdentificationProperties({ | ||
orderId: 0, | ||
checkoutOrderId: checkoutOrderId, | ||
}), | ||
).toEqual({ | ||
orderCode: undefined, | ||
orderId: checkoutOrderId, | ||
}); | ||
|
||
expect( | ||
getters.getCheckoutOrderIdentificationProperties({ | ||
orderId: '0', | ||
checkoutOrderId: checkoutOrderId, | ||
}), | ||
).toEqual({ | ||
orderCode: undefined, | ||
orderId: checkoutOrderId, | ||
}); | ||
|
||
expect( | ||
getters.getCheckoutOrderIdentificationProperties({ | ||
orderId: 12345, | ||
checkoutOrderId: checkoutOrderId, | ||
}), | ||
).toEqual({ | ||
orderCode: undefined, | ||
orderId: checkoutOrderId, | ||
}); | ||
|
||
expect( | ||
getters.getCheckoutOrderIdentificationProperties({ | ||
orderId: '12345', | ||
checkoutOrderId: checkoutOrderId, | ||
}), | ||
).toEqual({ | ||
orderCode: undefined, | ||
orderId: checkoutOrderId, | ||
}); | ||
|
||
expect( | ||
getters.getCheckoutOrderIdentificationProperties({ | ||
orderId: 'A12345', | ||
checkoutOrderId: checkoutOrderId, | ||
}), | ||
).toEqual({ | ||
orderCode: 'A12345', | ||
orderId: checkoutOrderId, | ||
}); | ||
|
||
expect( | ||
getters.getCheckoutOrderIdentificationProperties({ | ||
orderId: NaN, | ||
checkoutOrderId: checkoutOrderId, | ||
}), | ||
).toEqual({ | ||
orderCode: undefined, | ||
orderId: checkoutOrderId, | ||
}); | ||
|
||
expect( | ||
getters.getCheckoutOrderIdentificationProperties({ | ||
orderId: 123, | ||
checkoutOrderId: undefined, | ||
}), | ||
).toEqual({ | ||
orderCode: undefined, | ||
orderId: 123, | ||
}); | ||
}); | ||
}); | ||
}); |
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
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