Skip to content

Commit

Permalink
Update test Activity references
Browse files Browse the repository at this point in the history
  • Loading branch information
seadowg committed Nov 21, 2024
1 parent df73a7e commit a44178c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.odk.collect.android.external.FormUriActivity
import org.odk.collect.android.external.FormsContract
import org.odk.collect.android.formhierarchy.FormHierarchyActivity
import org.odk.collect.android.formhierarchy.FormHierarchyFragmentHostActivity
import org.odk.collect.android.formmanagement.FormFillingIntentFactory
import org.odk.collect.android.injection.config.AppDependencyComponent
import org.odk.collect.android.injection.config.AppDependencyModule
Expand Down Expand Up @@ -105,7 +105,7 @@ class FormFillingActivityTest {
}

scheduler.flush()
assertIntentsHelper.assertNewIntent(FormHierarchyActivity::class)
assertIntentsHelper.assertNewIntent(FormHierarchyFragmentHostActivity::class)

// Return to FormFillingActivity from FormHierarchyActivity
val hierarchyIntent = shadowOf(recreated.get()).nextStartedActivityForResult.intent
Expand Down Expand Up @@ -138,15 +138,15 @@ class FormFillingActivityTest {
assertText(withText("What is your age?"))

Interactions.clickOn(withContentDescription(R.string.view_hierarchy))
assertIntentsHelper.assertNewIntent(FormHierarchyActivity::class)
assertIntentsHelper.assertNewIntent(FormHierarchyFragmentHostActivity::class)

// Recreate and assert we start FormHierarchyActivity
val recreated = activityControllerRule.add {
initial.recreateWithProcessRestore { resetProcess(dependencies) }
}

scheduler.flush()
assertIntentsHelper.assertNewIntent(FormHierarchyActivity::class)
assertIntentsHelper.assertNewIntent(FormHierarchyFragmentHostActivity::class)

// Return to FormFillingActivity from FormHierarchyActivity
val hierarchyIntent = shadowOf(recreated.get()).nextStartedActivityForResult.intent
Expand Down Expand Up @@ -191,7 +191,7 @@ class FormFillingActivityTest {
}

scheduler.flush()
assertIntentsHelper.assertNewIntent(FormHierarchyActivity::class)
assertIntentsHelper.assertNewIntent(FormHierarchyFragmentHostActivity::class)

// Return to FormFillingActivity from FormHierarchyActivity
val hierarchyIntent = shadowOf(recreated.get()).nextStartedActivityForResult.intent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.odk.collect.android.TestSettingsProvider.getSettingsProvider
import org.odk.collect.android.formentry.FormEntryMenuProvider.FormEntryMenuClickListener
import org.odk.collect.android.formentry.backgroundlocation.BackgroundLocationViewModel
import org.odk.collect.android.formentry.questions.AnswersProvider
import org.odk.collect.android.formhierarchy.FormHierarchyActivity
import org.odk.collect.android.formhierarchy.FormHierarchyFragmentHostActivity
import org.odk.collect.android.javarosawrapper.FormController
import org.odk.collect.android.preferences.screens.ProjectPreferencesActivity
import org.odk.collect.android.utilities.ApplicationConstants
Expand Down Expand Up @@ -275,7 +275,7 @@ class FormEntryMenuProviderTest {
val nextStartedActivity = Shadows.shadowOf(activity).nextStartedActivityForResult

assertThat(nextStartedActivity, notNullValue())
assertThat(nextStartedActivity.intent.component!!.className, equalTo(FormHierarchyActivity::class.java.name))
assertThat(nextStartedActivity.intent.component!!.className, equalTo(FormHierarchyFragmentHostActivity::class.java.name))
assertThat(nextStartedActivity.requestCode, equalTo(ApplicationConstants.RequestCodes.HIERARCHY_ACTIVITY))
}

Expand Down

0 comments on commit a44178c

Please sign in to comment.