Open Bug 1970820 Opened 1 year ago Updated 8 months ago

Add tests for custom review prompt navigation middleware

Categories

(Firefox for Android :: Experimentation and Telemetry, task)

All
Android
task

Tracking

()

ASSIGNED

People

(Reporter: mkozinski, Assigned: mkozinski)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][group2])

We'd like to unit test action handling in CustomReviewPromptNavigationMiddleware. It works by emitting navigation events to a shared flow, so testing it is complicated, by the need to introduce a pattern for asserting expected emissions to a flow.

Assignee: nobody → mkozinski
Whiteboard: [fxdroid][group2]
Status: NEW → ASSIGNED
Blocks: review-prompt-followups
No longer blocks: review-prompt

I got feedback from Polly. Based on this there's one thing I want to expand on in the doc. I need to address more explicitly the cost of learning a new (testing) API. We agreed it would be helpful to include an example comparison of a unit test with and without Turbine.

Additionally I think this uncovers that the reason I'm proposing to introduce this new testing pattern is because I introduced a new pattern in production code. I did this without a formal proposal, it just went through code review on Squad 2. I talked to Petru about this pattern I used and apparently Rahul pitched it at some point, but we never either accepted or rejected it. I should either try to revive Rahul's proposal (if we can find it) or start my own. A new navigation pattern in production code definitely deserves a formal proposal even more than just introducing a new test dependency.

You need to log in before you can comment on or make changes to this bug.