aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@gmail.com>2017-07-18 13:04:48 +0300
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-07-18 13:04:48 +0300
commit347896905321f9b42788039b3112669c7c9a4eba (patch)
tree9536be7f2e02a77d85f4e9986093a45597b6eec8 /uitest
parentfa03b98014d25918f3c2f1476ae11df610605676 (diff)
downloadvaadin-framework-347896905321f9b42788039b3112669c7c9a4eba.tar.gz
vaadin-framework-347896905321f9b42788039b3112669c7c9a4eba.zip
Fix position of font icons in ComboBox (#9638)
Fixes #9637
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIcons.java26
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIconsTest.java23
2 files changed, 49 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIcons.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIcons.java
new file mode 100644
index 0000000000..c35aa2a06a
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIcons.java
@@ -0,0 +1,26 @@
+package com.vaadin.tests.components.combobox;
+
+import java.util.Arrays;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.icons.VaadinIcons;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.ComboBox;
+
+@Widgetset("com.vaadin.DefaultWidgetSet")
+public class ComboBoxVaadinIcons extends AbstractTestUI {
+
+ public static final VaadinIcons[] icons = new VaadinIcons[] {
+ VaadinIcons.AMBULANCE, VaadinIcons.PAPERPLANE,
+ VaadinIcons.AIRPLANE };
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ ComboBox<String> comboBox = new ComboBox<>();
+ comboBox.setItems(Arrays.stream(icons).map(VaadinIcons::name));
+ comboBox.setItemIconGenerator(VaadinIcons::valueOf);
+ addComponent(comboBox);
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIconsTest.java b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIconsTest.java
new file mode 100644
index 0000000000..0e71475d9f
--- /dev/null
+++ b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIconsTest.java
@@ -0,0 +1,23 @@
+package com.vaadin.tests.components.combobox;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.openqa.selenium.Keys;
+
+import com.vaadin.testbench.elements.ComboBoxElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class ComboBoxVaadinIconsTest extends MultiBrowserTest {
+
+ @Test
+ public void testComboBoxIconRendering() throws IOException {
+ openTestURL();
+ ComboBoxElement comboBox = $(ComboBoxElement.class).first();
+ comboBox.openPopup();
+ compareScreen(comboBox.getSuggestionPopup(), "popup");
+ comboBox.sendKeys(Keys.ARROW_DOWN, Keys.ARROW_DOWN, Keys.ENTER);
+ compareScreen(comboBox, "paperplane");
+ }
+
+}