aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/components/ui/ComboboxSelectedItemText.java
blob: e8e79a6cfec76b3725843fe0cb411622a10ee39d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.vaadin.tests.components.ui;

import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractReindeerTestUIWithLog;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Label;

public class ComboboxSelectedItemText extends AbstractReindeerTestUIWithLog {
    @Override
    protected void setup(VaadinRequest request) {
        getLayout().addComponent(new Label(
                "Select first ANTIGUA AND BARBUDA from the first combobox. Then select ANTIGUA AND BARBUDA from the second combobox. Finally, click the popup button on the first combobox. Before fix you would see UA AND BAR in the field."));

        ComboBox<String> combobox = new ComboBox<>("Text input enabled:");
        combobox.setWidth("100px");

        combobox.setItems("AMERICAN SAMOA", "ANTIGUA AND BARBUDA");

        ComboBox<String> combobox2 = new ComboBox<>("Text input disabled:");
        combobox2.setWidth("100px");
        combobox2.setTextInputAllowed(false);

        combobox2.setItems("AMERICAN SAMOA", "ANTIGUA AND BARBUDA");

        getLayout().addComponent(combobox);
        getLayout().addComponent(combobox2);
    }

    @Override
    protected String getTestDescription() {
        return "Tests selected item is displayed from the beginning";
    }

    @Override
    protected Integer getTicketNumber() {
        return 13477;
    }

}