use of org.odk.collect.testshared.ErrorIntentLauncher in project collect by opendatakit.
the class QRCodeMenuDelegateTest method clickingOnImportQRCode_whenPickerActivityNotAvailable_showsToast.
@Test
public void clickingOnImportQRCode_whenPickerActivityNotAvailable_showsToast() {
intentLauncher = new ErrorIntentLauncher();
setupMenuDelegate();
menuDelegate.onOptionsItemSelected(new RoboMenuItem(R.id.menu_item_scan_sd_card));
assertThat(shadowOf(activity).getNextStartedActivityForResult(), is(nullValue()));
assertThat(ShadowToast.getLatestToast(), notNullValue());
}
use of org.odk.collect.testshared.ErrorIntentLauncher in project collect by opendatakit.
the class OSMWidgetTest method clickingButton_whenActivityIsNotAvailable_CancelsWaitingForData.
@Test
public void clickingButton_whenActivityIsNotAvailable_CancelsWaitingForData() {
intentLauncher = new ErrorIntentLauncher();
OSMWidget widget = createWidget(promptWithAnswer(null));
widget.binding.launchOpenMapKitButton.performClick();
assertThat(fakeWaitingForDataRegistry.waiting.isEmpty(), is(true));
}
use of org.odk.collect.testshared.ErrorIntentLauncher in project collect by opendatakit.
the class OSMWidgetTest method clickingButton_whenActivityIsNotAvailable_showsErrorTextView.
@Test
public void clickingButton_whenActivityIsNotAvailable_showsErrorTextView() {
intentLauncher = new ErrorIntentLauncher();
OSMWidget widget = createWidget(promptWithAnswer(null));
widget.binding.launchOpenMapKitButton.performClick();
assertThat(widget.binding.errorText.getVisibility(), is(View.VISIBLE));
}
Aggregations