use of org.odk.collect.android.support.MockFormEntryPromptBuilder in project collect by opendatakit.
the class SelectOneWidgetTest method whenQuickAppearanceIsNotUsed_shouldNotAdvanceToNextListenerBeCalledInNoButtonsMode.
@Test
public void whenQuickAppearanceIsNotUsed_shouldNotAdvanceToNextListenerBeCalledInNoButtonsMode() {
formEntryPrompt = new MockFormEntryPromptBuilder().withSelectChoices(asList(new SelectChoice("AAA", "AAA"), new SelectChoice("BBB", "BBB"))).withAppearance("no-buttons").build();
SelectOneWidget widget = getWidget();
populateRecyclerView(widget);
// Select AAA
clickChoice(widget, 0);
assertThat(widget.getAnswer().getDisplayText(), is("AAA"));
verify(listener, times(0)).advance();
}
use of org.odk.collect.android.support.MockFormEntryPromptBuilder in project collect by opendatakit.
the class SelectOneWidgetTest method whenQuickAppearanceIsUsed_shouldAdvanceToNextListenerBeCalledInButtonsMode.
@Test
public void whenQuickAppearanceIsUsed_shouldAdvanceToNextListenerBeCalledInButtonsMode() {
formEntryPrompt = new MockFormEntryPromptBuilder().withSelectChoices(asList(new SelectChoice("AAA", "AAA"), new SelectChoice("BBB", "BBB"))).withAppearance("quick").build();
SelectOneWidget widget = getWidget();
populateRecyclerView(widget);
// Select AAA
clickChoice(widget, 0);
assertThat(widget.getAnswer().getDisplayText(), is("AAA"));
verify(listener).advance();
}
use of org.odk.collect.android.support.MockFormEntryPromptBuilder in project collect by opendatakit.
the class SelectOneWidgetTest method whenQuickAppearanceIsUsed_shouldAdvanceToNextListenerBeCalledInNoButtonsMode.
@Test
public void whenQuickAppearanceIsUsed_shouldAdvanceToNextListenerBeCalledInNoButtonsMode() {
formEntryPrompt = new MockFormEntryPromptBuilder().withSelectChoices(asList(new SelectChoice("AAA", "AAA"), new SelectChoice("BBB", "BBB"))).withAppearance("quick no-buttons").build();
SelectOneWidget widget = getWidget();
populateRecyclerView(widget);
// Select AAA
clickChoice(widget, 0);
assertThat(widget.getAnswer().getDisplayText(), is("AAA"));
verify(listener).advance();
}
use of org.odk.collect.android.support.MockFormEntryPromptBuilder in project collect by opendatakit.
the class ListMultiWidgetTest method whenSpacesInUnderlyingValuesExist_shouldAppropriateWarningBeDisplayed.
@Test
public void whenSpacesInUnderlyingValuesExist_shouldAppropriateWarningBeDisplayed() {
formEntryPrompt = new MockFormEntryPromptBuilder().withSelectChoices(asList(new SelectChoice("a", "a a"), new SelectChoice("a", "b b"))).build();
TextView warningTv = getWidget().findViewById(R.id.warning_text);
assertThat(warningTv.getVisibility(), is(View.VISIBLE));
assertThat(warningTv.getText(), is("Warning: underlying values a a, b b have spaces"));
}
use of org.odk.collect.android.support.MockFormEntryPromptBuilder in project collect by opendatakit.
the class SelectMultiImageMapWidgetTest method whenSpacesInUnderlyingValuesExist_shouldAppropriateWarningBeDisplayed.
@Test
public void whenSpacesInUnderlyingValuesExist_shouldAppropriateWarningBeDisplayed() {
formEntryPrompt = new MockFormEntryPromptBuilder().withSelectChoices(asList(new SelectChoice("a", "a a"), new SelectChoice("a", "b b"))).withImageURI("jr://images/body.svg").build();
TextView warningTv = getWidget().findViewById(R.id.warning_text);
assertThat(warningTv.getVisibility(), is(View.VISIBLE));
assertThat(warningTv.getText(), is("Warning: underlying values a a, b b have spaces"));
}
Aggregations