test(workflow): add test for trigger type mismatch in WorkflowNavigator#3387
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3387 +/- ##
=======================================
Coverage 80.26% 80.26%
=======================================
Files 378 378
Lines 15448 15448
Branches 2143 2143
=======================================
Hits 12400 12400
Misses 2189 2189
Partials 859 859 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Adds a missing WorkflowNavigatorTest case verifying triggerAction returns null and does not navigate when the componentId matches but the WorkflowTriggerType does not. Suggested during review of #3386. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dd01e3a to
bf6876a
Compare
vegaro
approved these changes
Jun 12, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a missing
WorkflowNavigatorTestcase forWorkflowNavigator.triggerAction: when thecomponentIdmatches an existing trigger but the suppliedWorkflowTriggerTypedoes not,triggerActionmust returnnulland leave the current step unchanged.This is a test-only change. The production logic it guards (the
&& it.type == triggerTypefilter) already landed in main via #3386. This test is the only one that pins the type half of that filter: the existingunknown componentIdtest would still pass if the type check were removed, whereas this one fails.Suggested during review of #3386.
Test plan
triggerAction with mismatched trigger type returns null and does not navigateWorkflowNavigatorTest(./gradlew :ui:revenuecatui:testDefaultsBc8DebugUnitTest --tests "...WorkflowNavigatorTest"→ BUILD SUCCESSFUL)AI session context
AI Context
Metadata
facu/workflow-trigger-type-mismatch-testGoal
Bring stale PR #3387 up to date and decide whether it still makes sense or should be closed. Outcome: kept as a focused test-only addition.
Initial Prompt
"Check PR #3387, put it up-to-date, and then see if it still makes sense, or we should close it." Follow-up: "Does the test still make sense?"
Agent Contribution
CONFLICTING/DIRTYwith a large diff: it was branched off CreateWorkflowTriggerTypeandWorkflowTriggerActionType#3386's branch, and CreateWorkflowTriggerTypeandWorkflowTriggerActionType#3386 was squash-merged into main on 2026-04-27, so the un-rebased branch re-showed CreateWorkflowTriggerTypeandWorkflowTriggerActionType#3386's changes.origin/main, dropping the 4 redundant CreateWorkflowTriggerTypeandWorkflowTriggerActionType#3386 commits, and re-applied only the unique new test, adapting it to main's evolved API (navigator.currentStepproperty instead ofcurrentStep()).Human Decisions
Key Implementation Decisions
origin/mainand re-apply only the new test, rather than resolve the rebase conflicts commit-by-commit.WorkflowTriggerTypeandWorkflowTriggerActionType#3386 content already merged into main; rebasing them produced conflicts and added no value. The only unique content was an 8-line test.git rebase origin/maincarrying all 5 commits (produced conflicts on already-merged code).Files / Symbols Touched
ui/revenuecatui/src/test/kotlin/com/revenuecat/purchases/ui/revenuecatui/workflow/WorkflowNavigatorTest.kttriggerAction with mismatched trigger type returns null and does not navigateit.type == triggerTypefilter (matchingcomponentIdbtn-next, mismatching typeUNKNOWN).Dependencies / Config / Migrations
Validation
./gradlew :ui:revenuecatui:testDefaultsBc8DebugUnitTest --tests "com.revenuecat.purchases.ui.revenuecatui.workflow.WorkflowNavigatorTest": BUILD SUCCESSFUL.Validation Gaps
Review Focus
navigator.currentStep(property) consistent with the rest of the file post-CreateWorkflowTriggerTypeandWorkflowTriggerActionType#3386.Risks / Reviewer Notes
Non-goals / Out of Scope
triggerTypefilter itself shipped in CreateWorkflowTriggerTypeandWorkflowTriggerActionType#3386.Omitted Context
Note
Low Risk
Test-only change with no runtime behavior impact.
Overview
Adds a unit test in
WorkflowNavigatorTestfortriggerActionwhen thecomponentIdmatches a trigger (btn-next) but theWorkflowTriggerTypedoes not (UNKNOWNvsON_PRESS). The test asserts the result isnullandcurrentStepstays on the initial step.This complements the existing unknown-
componentIdcase by locking in theit.type == triggerTypebranch inWorkflowNavigator.triggerAction(already on main). No production code changes.Reviewed by Cursor Bugbot for commit f32d1b5. Bugbot is set up for automated code reviews on this repo. Configure here.