Skip to content

test: add message flow tests for 3DS bootstrap and credit card tokenization#24

Merged
arstiefel merged 1 commit intomainfrom
test-add-message-flow-tests-for
Mar 12, 2026
Merged

test: add message flow tests for 3DS bootstrap and credit card tokenization#24
arstiefel merged 1 commit intomainfrom
test-add-message-flow-tests-for

Conversation

@arstiefel
Copy link
Collaborator

@arstiefel arstiefel commented Mar 12, 2026

Description

Add comprehensive message flow unit tests for the 3DS bootstrap and credit card tokenization patterns. This PR introduces two new test files — useThreeDSecure.test.tsx (covering FetchReferenceID → VerificationIDResult, TriggerAuthWithConfig → Result, full bootstrap sequence, input validation, and error codes) and useCreditCardController.test.ts (covering GetToken → GetTokenReply success/error, field events, SetConfig, SetStyles, parseBoltMessage, and validation error codes). Together these add 29 new tests, bringing the total from 60 to 89. The implementation plan is also updated to reflect Phase 7.1 progress and the deferral of the setPort RPC channel.

Testing

  • 29 new unit tests across two test files validate the WebView bridge message protocol for both credit card tokenization and 3DS flows.
  • useCreditCardController.test.ts: Tests GetToken send, successful/error GetTokenReply parsing, field events (Focus, Blur, Valid, Error, FrameInitialized), SetConfig/SetStyles outbound messages, parseBoltMessage edge cases, and validation error code mappings.
  • useThreeDSecure.test.tsx: Tests FetchReferenceID with token and credit card ID fields, VerificationIDResult success/error, TriggerAuthWithConfig payload, Result success/failure, ThreeDSError code mappings, and the full FetchReferenceID → TriggerAuthWithConfig bootstrap integration flow.
  • All 89 tests pass (npm test).

Security Review

Important

A security review is required for every PR in this repository to comply with PCI requirements.

  • I have considered and reviewed security implications of this PR and included the summary below.

Security Impact Summary

No security-sensitive changes. This PR adds test files only and updates the implementation plan document. It does not modify authentication, authorization, payment flows, user data handling, or external integrations. Test data uses fake tokens (e.g., tok_test_abc123) and does not contain real credentials.

@snyk-io
Copy link

snyk-io bot commented Mar 12, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@arstiefel arstiefel force-pushed the test-add-message-flow-tests-for branch from 05fbd3d to 86cf075 Compare March 12, 2026 16:31
@arstiefel arstiefel enabled auto-merge (squash) March 12, 2026 16:48
@arstiefel arstiefel merged commit 5fef7d5 into main Mar 12, 2026
7 checks passed
@arstiefel arstiefel deleted the test-add-message-flow-tests-for branch March 12, 2026 17:34
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