aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/test/java')
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java7
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java21
2 files changed, 26 insertions, 2 deletions
diff --git a/server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java
index 1677f8699b..e2a0c67f2a 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java
@@ -48,12 +48,14 @@ public class ComboBoxDeclarativeTest
int pageLength = 7;
String popupWidth = "11%";
boolean emptySelectionAllowed = false;
+ String emptySelectionCaption = "foo";
String design = String.format(
"<%s placeholder='%s' text-input-allowed='%s' page-length='%d' "
- + "popup-width='%s' empty-selection-allowed='%s' scroll-to-selected-item/>",
+ + "popup-width='%s' empty-selection-allowed='%s' "
+ + "scroll-to-selected-item empty-selection-caption='%s'/>",
getComponentTag(), placeholder, textInputAllowed, pageLength,
- popupWidth, emptySelectionAllowed);
+ popupWidth, emptySelectionAllowed, emptySelectionCaption);
ComboBox<String> comboBox = new ComboBox<>();
comboBox.setPlaceholder(placeholder);
@@ -62,6 +64,7 @@ public class ComboBoxDeclarativeTest
comboBox.setPopupWidth(popupWidth);
comboBox.setScrollToSelectedItem(true);
comboBox.setEmptySelectionAllowed(emptySelectionAllowed);
+ comboBox.setEmptySelectionCaption(emptySelectionCaption);
testRead(design, comboBox);
testWrite(design, comboBox);
diff --git a/server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java
index 2b80546e80..fea6ac3b12 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java
@@ -15,6 +15,8 @@
*/
package com.vaadin.tests.server.component.nativeselect;
+import org.junit.Test;
+
import com.vaadin.tests.server.component.abstractsingleselect.AbstractSingleSelectDeclarativeTest;
import com.vaadin.ui.NativeSelect;
@@ -29,6 +31,25 @@ import com.vaadin.ui.NativeSelect;
public class NativeSelectDeclarativeTest
extends AbstractSingleSelectDeclarativeTest<NativeSelect> {
+ @Test
+ public void nativeSelectSpecificPropertiesSerialize() {
+ boolean emptySelectionAllowed = false;
+ String emptySelectionCaption = "foo";
+
+ String design = String.format(
+ "<%s empty-selection-allowed='%s' "
+ + "empty-selection-caption='%s'/>",
+ getComponentTag(), emptySelectionAllowed,
+ emptySelectionCaption);
+
+ NativeSelect<String> select = new NativeSelect<>();
+ select.setEmptySelectionAllowed(emptySelectionAllowed);
+ select.setEmptySelectionCaption(emptySelectionCaption);
+
+ testRead(design, select);
+ testWrite(design, select);
+ }
+
@Override
protected String getComponentTag() {
return "vaadin-native-select";