Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpoole committed Oct 20, 2024
1 parent 2497e33 commit 840cf69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public void nodeWithDirection1() {
fail();
}
assertNotNull(direction);
assertEquals("Type or tap for values", direction.getText());
assertEquals(main.getString(R.string.tag_dialog_value_hint), direction.getText());
direction.clickAndWait(Until.newWindow(), 2000);
TestUtils.clickText(device, true, main.getString(R.string.save), true, false);
TestUtils.clickHome(device, true);
Expand Down Expand Up @@ -371,12 +371,12 @@ public void nodeWithDirection2() {
fail();
}
assertNotNull(direction);
assertEquals("Type or tap for values", direction.getText());
assertEquals(main.getString(R.string.tag_dialog_value_hint), direction.getText());
direction.clickAndWait(Until.newWindow(), 2000);
TestUtils.clickText(device, true, "Forward", false, false);
TestUtils.clickText(device, true, main.getString(R.string.save), true, false);
TestUtils.clickHome(device, true);
assertEquals("forward", n.getTagWithKey("direction"));
assertEquals("forward", n.getTagWithKey("direction").toLowerCase());
}

@Test
Expand Down Expand Up @@ -410,7 +410,7 @@ public void nodeWithDirection3() {
fail();
}
assertNotNull(direction);
assertEquals("forward", direction.getText());
assertEquals("forward", direction.getText().toLowerCase());
direction.clickAndWait(Until.newWindow(), 2000);
TestUtils.clickText(device, true, "Forward", false, false);
TestUtils.clickText(device, true, main.getString(R.string.save), true, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,16 @@
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import de.blau.android.R;
import de.blau.android.presets.PresetComboField;
import de.blau.android.presets.PresetItem;
import de.blau.android.presets.PresetTagField;
import de.blau.android.presets.ValueType;
import de.blau.android.propertyeditor.TagChanged;
import de.blau.android.util.StringWithDescription;
import de.blau.android.util.StringWithDescriptionAndIcon;
import de.blau.android.util.Value;
import de.blau.android.views.CustomAutoCompleteTextView;

public class ValueWidgetRow extends DialogRow implements TagChanged {

Expand Down Expand Up @@ -66,11 +60,11 @@ static ValueWidgetRow getRow(@NonNull final TagFormFragment caller, @NonNull fin
final Map<String, String> allTags) {
final ValueWidgetRow row = (ValueWidgetRow) inflater.inflate(R.layout.tag_form_value_widget_row, rowLayout, false);
final String key = field.getKey();
final String hint = preset != null ? field.getHint() : key;
final String hint = field.getHint();
row.keyView.setText(hint);
row.keyView.setTag(key);
row.setPreset(preset);
row.valueType = preset != null ? preset.getValueType(key) : null;
row.valueType = preset.getValueType(key);
row.field = field;

row.valueView.setHint(R.string.tag_dialog_value_hint);
Expand Down

0 comments on commit 840cf69

Please sign in to comment.