https://kotlinlang.org logo
#orbit-mvi
Title
# orbit-mvi
r

Rak

01/10/2022, 4:43 PM
Hi, is the reason that I have to pass a
State
to the
test
method in my unit tests so that I can fast forward to any point in the state machine? Its just strange passing it in when the viewmodel should do the initial state. Would it not be better as an optional parameter for when you do want to skip the initial state?
1
m

Mikolaj Leszczynski

01/11/2022, 8:21 AM
Yes indeed. The point is not to have to invoke a bunch of intents just to get your VM to a correct initial state for the test. We opted to be explicit here as a first iteration, but I agree it’s a good idea to make the initial state optional - you don’t want to have to repeat yourself. I’ll add a ticket to our backlog.
🙌 2
4 Views