diff options
author | Artur Signell <artur@vaadin.com> | 2014-12-09 22:16:50 +0200 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2014-12-11 07:20:28 +0000 |
commit | c4e4f449464f22c11e33b92f8aa578db959e92b2 (patch) | |
tree | b673bea7db35b3a55a13d4cb07e4012ee68c8f8c /uitest | |
parent | b91063f884108bfc69a617846d91263339b062fe (diff) | |
download | vaadin-framework-c4e4f449464f22c11e33b92f8aa578db959e92b2.tar.gz vaadin-framework-c4e4f449464f22c11e33b92f8aa578db959e92b2.zip |
Convert empty string to null Enum value, only throw ConversionExceptions (#14756)
Change-Id: I027a245975db12e3661740bd233edd98e73994e9
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/textfield/EnumTextField.java | 1 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/textfield/EnumTextFieldTest.java | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/uitest/src/com/vaadin/tests/components/textfield/EnumTextField.java b/uitest/src/com/vaadin/tests/components/textfield/EnumTextField.java index 67b3b84688..99e08ae32d 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/EnumTextField.java +++ b/uitest/src/com/vaadin/tests/components/textfield/EnumTextField.java @@ -31,6 +31,7 @@ public class EnumTextField extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { final TextField tf = new TextField(); + tf.setNullRepresentation(""); tf.addValueChangeListener(new ValueChangeListener() { @Override diff --git a/uitest/src/com/vaadin/tests/components/textfield/EnumTextFieldTest.java b/uitest/src/com/vaadin/tests/components/textfield/EnumTextFieldTest.java index 113acee3a2..fe26fb7aad 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/EnumTextFieldTest.java +++ b/uitest/src/com/vaadin/tests/components/textfield/EnumTextFieldTest.java @@ -27,8 +27,7 @@ public class EnumTextFieldTest extends SingleBrowserTest { public void validValues() { openTestURL(); $(TextFieldElement.class).first().clear(); - $(TextFieldElement.class).first().sendKeys("Value"); - $(TextFieldElement.class).first().sendKeys(Keys.TAB); + $(TextFieldElement.class).first().sendKeys("Value", Keys.TAB); Assert.assertEquals("3. Value (valid)", getLogRow(0)); $(TextFieldElement.class).first().clear(); @@ -41,13 +40,15 @@ public class EnumTextFieldTest extends SingleBrowserTest { $(TextFieldElement.class).first().sendKeys(Keys.TAB); Assert.assertEquals("7. The last value (valid)", getLogRow(0)); + $(TextFieldElement.class).first().clear(); + Assert.assertEquals("8. null (valid)", getLogRow(0)); + } @Test public void invalidValue() { openTestURL(); $(TextFieldElement.class).first().clear(); - Assert.assertEquals("2. (INVALID)", getLogRow(0)); $(TextFieldElement.class).first().sendKeys("bar"); $(TextFieldElement.class).first().sendKeys(Keys.TAB); |