diff options
author | Artur Signell <artur@vaadin.com> | 2016-05-06 18:04:06 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-05-09 12:44:19 +0000 |
commit | d3c617a77dcf6df7cf200f45430fb35b671121ac (patch) | |
tree | b516cea88bc3b4458cdbd67f7a78ea34114946ee /uitest | |
parent | e5765f1e53b47354b5d0910fe0c19c008734ba53 (diff) | |
download | vaadin-framework-d3c617a77dcf6df7cf200f45430fb35b671121ac.tar.gz vaadin-framework-d3c617a77dcf6df7cf200f45430fb35b671121ac.zip |
Fix null selection to work again (#19787)
Reverts the fix for #15181
Change-Id: I9ec45b1c9aad9788559d0de2b086bf5cf4af6b12
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/nativeselect/NativeSelectNull.java | 25 | ||||
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectNullTest.java | 20 |
2 files changed, 45 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/nativeselect/NativeSelectNull.java b/uitest/src/main/java/com/vaadin/tests/components/nativeselect/NativeSelectNull.java new file mode 100644 index 0000000000..fb5914f395 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/nativeselect/NativeSelectNull.java @@ -0,0 +1,25 @@ +package com.vaadin.tests.components.nativeselect; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.NativeSelect; + +public class NativeSelectNull extends AbstractTestUIWithLog { + @Override + protected void setup(VaadinRequest request) { + NativeSelect nativeSelect = new NativeSelect(); + nativeSelect.addItem("Item"); + nativeSelect.addValueChangeListener(new ValueChangeListener() { + + @Override + public void valueChange(ValueChangeEvent event) { + log("Value: " + event.getProperty().getValue()); + + } + }); + addComponent(nativeSelect); + } + +} diff --git a/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectNullTest.java b/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectNullTest.java new file mode 100644 index 0000000000..613efbb566 --- /dev/null +++ b/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectNullTest.java @@ -0,0 +1,20 @@ +package com.vaadin.tests.components.nativeselect; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.testbench.elements.NativeSelectElement; +import com.vaadin.tests.tb3.SingleBrowserTest; +import com.vaadin.tests.tb3.SingleBrowserTestPhantomJS2; + +public class NativeSelectNullTest extends SingleBrowserTestPhantomJS2 { + @Test + public void selectNull() { + openTestURL(); + NativeSelectElement select = $(NativeSelectElement.class).first(); + select.selectByText("Item"); + Assert.assertEquals("1. Value: Item", getLogRow(0)); + select.selectByText(""); + Assert.assertEquals("2. Value: null", getLogRow(0)); + } +} |