diff options
author | Matti Tahvonen <matti@vaadin.com> | 2017-05-19 11:30:29 +0300 |
---|---|---|
committer | Aleksi Hietanen <aleksi@vaadin.com> | 2017-05-19 11:30:29 +0300 |
commit | 9b72cbfa113c48f2c396055f8ff04970d2ae3aa1 (patch) | |
tree | de7731672081bfe44c563516d004c61d990b5ddc /uitest | |
parent | d7142d1870bd45d5a9bb79b0d89edf3f3a5033ab (diff) | |
download | vaadin-framework-9b72cbfa113c48f2c396055f8ff04970d2ae3aa1.tar.gz vaadin-framework-9b72cbfa113c48f2c396055f8ff04970d2ae3aa1.zip |
Fix resetting of last filter in VComboBox (#9381)
Currently the reset method resets the lastFilter as well and then the logic thinks items don’t need to be refreshed when popup is reopened.
Fixes #9027
Fixes #7790
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingTest.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingTest.java b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingTest.java index cf3450a14f..616c9a8e82 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingTest.java @@ -3,6 +3,7 @@ package com.vaadin.tests.components.combobox; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import org.junit.Assert; import org.junit.Test; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; @@ -28,6 +29,31 @@ public class ComboBoxSelectingTest extends MultiBrowserTest { } @Test + public void ensureOldFilterIsCleared() { + comboBoxElement.openPopup(); + int initialVisibleOptions = countVisibleOptions(); + clearInputAndType("b11"); + int visibleOptionsAfterFiltering = countVisibleOptions(); + Assert.assertEquals(1, visibleOptionsAfterFiltering); + clickOnLabel(); + sleep(1000); + // no selection was made, clicking on arrow should show all options + // again + comboBoxElement.openPopup(); + + int visibleOptions = countVisibleOptions(); + Assert.assertEquals(initialVisibleOptions, visibleOptions); + } + + private int countVisibleOptions() { + return comboBoxElement.getPopupSuggestions().size(); + } + + private void clickOnLabel() { + getDriver().findElement(By.cssSelector(".v-label")).click(); + } + + @Test public void firstSuggestionIsSelectedWithEnter() { typeInputAndHitEnter("a"); |