Skip to content

Commit

Permalink
Fixed imports in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed May 5, 2021
1 parent 360cede commit 3b40dd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public void whenMainMenuPreferencesDisplayed_shouldIsInAdminModeReturnTrue() {
adminPreferencesFragment.onPreferenceClick(preference);
activityController.resume();

AdminPreferencesFragment.MainMenuAccessPreferences preferences
= (AdminPreferencesFragment.MainMenuAccessPreferences) activityController.get()
MainMenuAccessPreferencesFragment preferences
= (MainMenuAccessPreferencesFragment) activityController.get()
.getSupportFragmentManager()
.findFragmentById(R.id.preferences_fragment_container);

Expand All @@ -116,8 +116,8 @@ public void whenUserPreferencesDisplayed_shouldIsInAdminModeReturnTrue() {
adminPreferencesFragment.onPreferenceClick(preference);
activityController.resume();

AdminPreferencesFragment.UserSettingsAccessPreferences preferences
= (AdminPreferencesFragment.UserSettingsAccessPreferences) activityController.get()
UserSettingsAccessPreferencesFragment preferences
= (UserSettingsAccessPreferencesFragment) activityController.get()
.getSupportFragmentManager()
.findFragmentById(R.id.preferences_fragment_container);

Expand All @@ -132,8 +132,8 @@ public void whenFormEntryPreferencesDisplayed_shouldIsInAdminModeReturnTrue() {
adminPreferencesFragment.onPreferenceClick(preference);
activityController.resume();

AdminPreferencesFragment.FormEntryAccessPreferences preferences
= (AdminPreferencesFragment.FormEntryAccessPreferences) activityController.get()
FormEntryAccessPreferencesFragment preferences
= (FormEntryAccessPreferencesFragment) activityController.get()
.getSupportFragmentManager()
.findFragmentById(R.id.preferences_fragment_container);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.odk.collect.android.preferences.keys.GeneralKeys;
import org.odk.collect.shared.Settings;
import org.odk.collect.android.preferences.Protocol;
import org.odk.collect.android.preferences.screens.AdminPreferencesFragment.MainMenuAccessPreferences;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
Expand All @@ -41,7 +40,7 @@ public void setup() {
public void whenMatchExactlyEnabled_showsGetBlankFormAsUncheckedAndDisabled() {
generalSettings.save(GeneralKeys.KEY_FORM_UPDATE_MODE, FormUpdateMode.MATCH_EXACTLY.getValue(context));

FragmentScenario<MainMenuAccessPreferences> scenario = FragmentScenario.launch(MainMenuAccessPreferences.class);
FragmentScenario<MainMenuAccessPreferencesFragment> scenario = FragmentScenario.launch(MainMenuAccessPreferencesFragment.class);
scenario.onFragment(f -> {
CheckBoxPreference getBlankForm = f.findPreference(KEY_GET_BLANK);
assertThat(getBlankForm.isEnabled(), is(false));
Expand All @@ -55,7 +54,7 @@ public void whenMatchExactlyEnabled_andGoogleUsedAsProtocol_getBlankFormIsEnable
generalSettings.save(GeneralKeys.KEY_FORM_UPDATE_MODE, FormUpdateMode.MATCH_EXACTLY.getValue(context));
generalSettings.save(GeneralKeys.KEY_PROTOCOL, Protocol.GOOGLE.getValue(context));

FragmentScenario<MainMenuAccessPreferences> scenario = FragmentScenario.launch(MainMenuAccessPreferences.class);
FragmentScenario<MainMenuAccessPreferencesFragment> scenario = FragmentScenario.launch(MainMenuAccessPreferencesFragment.class);
scenario.onFragment(f -> {
CheckBoxPreference getBlankForm = f.findPreference(KEY_GET_BLANK);
assertThat(getBlankForm.isEnabled(), is(true));
Expand Down

0 comments on commit 3b40dd0

Please sign in to comment.