aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxAddingSameItemTwoTimesWithItemHandlerResetTest.java
blob: dbaa3a648fc704c0c0fa88fab7e5276d1ec3c373 (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
package com.vaadin.tests.components.combobox;

public class ComboBoxAddingSameItemTwoTimesWithItemHandlerResetTest
        extends ComboBoxSelectingNewItemValueChangeTest {

    @Override
    public void itemHandling(
            ComboBoxSelectingNewItemValueChangeTest.SelectionType selectionType,
            String[] inputs) {
        assertThatSelectedValueIs("");

        // add new item for the first time
        typeInputAndSelect(inputs[0], selectionType);
        assertThatSelectedValueIs(inputs[0]);
        assertValueChange(1);

        reset();

        // add the same item for the 2nd time
        typeInputAndSelect(inputs[0], selectionType);
        assertThatSelectedValueIs(inputs[0]);
        assertValueChange(1);
    }
}