File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
WordPress/src/test/java/org/wordpress/android/ui/sitecreation Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,19 @@ class SiteCreationMainVMTest : BaseUnitTest() {
364364 verify(tracker, times(1 )).trackSiteCreationAccessed(SiteCreationSource .UNSPECIFIED )
365365 }
366366
367+ @Test
368+ fun `given instance state returns an invalid step, when start, then site creation is reset` () {
369+ val expectedState = SiteCreationState (segmentId = SEGMENT_ID )
370+ whenever(savedInstanceState.getParcelableCompat<SiteCreationState >(KEY_SITE_CREATION_STATE ))
371+ .thenReturn(expectedState)
372+ whenever(savedInstanceState.getInt(KEY_CURRENT_STEP )).thenReturn(- 1 ) // Invalid step
373+
374+ val newViewModel = getNewViewModel()
375+ newViewModel.start(savedInstanceState, SiteCreationSource .UNSPECIFIED )
376+
377+ verify(wizardManager).setCurrentStepIndex(0 )
378+ }
379+
367380 private fun currentWizardState (vm : SiteCreationMainVM ) = vm.navigationTargetObservable.lastEvent!! .wizardState
368381
369382 private fun getNewViewModel () = SiteCreationMainVM (
You can’t perform that action at this time.
0 commit comments