Skip to content

ci: Add iOS Integration Style Unit Tests#338

Open
BrandonStalnaker wants to merge 2 commits into
mainfrom
CI/Add-iOS-Integration-style-Unit-Tests
Open

ci: Add iOS Integration Style Unit Tests#338
BrandonStalnaker wants to merge 2 commits into
mainfrom
CI/Add-iOS-Integration-style-Unit-Tests

Conversation

@BrandonStalnaker
Copy link
Copy Markdown
Contributor

Summary

  • iOS New Architecture: logCommerceEvent now maps productActionType through [RCTConvert MPCommerceEventAction:] (same as the legacy bridge) instead of casting to MPCommerceEventAction, fixing scrambled product commerce actions.
  • Promotions: promotionActionType is mapped with [RCTConvert MPPromotionAction:] because JS order (View=0, Click=1) does not match MPPromotionAction (Click=0, View=1). Applied in New Arch logCommerceEvent and in [RCTConvert MPPromotionContainer:].
  • Legacy helper: RCTConvert (MParticle) MPCommerceEvent: now uses MPCommerceEventAction: for productActionType instead of a raw cast.CI / tests: PR workflow runs focused XCTests in the sample app (RCTConvertCommerceMappingTests) covering enum mapping and JSON → MPCommerceEvent / MPPromotionContainer. Sample README documents how to run them locally.

Testing Plan

  • Automated: xcodebuild test in CI (sample workspace) with -only-testing:MParticleSampleTests/RCTConvertCommerceMappingTests after pod install.
  • Manual (recommended once): On an iOS New Arch build, log a product-action commerce event and a promotion commerce event and confirm actions match JS constants in verbose / payload output.
  • Note: XCTests exercise RCTConvert and the JSON MPCommerceEvent assembly path; they do not drive the TurboModule JSI struct entry point directly.

Master Issue

Closes https://go.mparticle.com/work/REPLACEME

@BrandonStalnaker BrandonStalnaker self-assigned this Jun 5, 2026
@BrandonStalnaker BrandonStalnaker requested a review from a team as a code owner June 5, 2026 16:55
@cursor
Copy link
Copy Markdown

cursor Bot commented Jun 5, 2026

PR Summary

Low Risk
Changes are limited to sample tests, CI, and docs; no production SDK or app runtime code in this diff.

Overview
Adds RCTConvertCommerceMappingTests to the sample iOS test target to lock in JS ProductActionType / PromotionActionType integers → Apple SDK enums and JSON → +[RCTConvert MPCommerceEvent:] (including promotion container wiring). The tests intentionally cover the legacy RCTConvert assembly path, not the TurboModule codegen entry point.

The iOS Sample App PR workflow step switches from xcodebuild build-only to test scoped to that suite (-only-testing:MParticleSampleTests/RCTConvertCommerceMappingTests), with a comment reminding maintainers to keep the job display name aligned with branch protection. sample/README.md documents how to run the same tests locally.

Reviewed by Cursor Bugbot for commit a44077d. Bugbot is set up for automated code reviews on this repo. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants