]> source.dussan.org Git - vaadin-framework.git/commitdiff
Change forceUpdate flag to always force recalculation of width. Fix tests. (#13444)
authorMarkus Koivisto <markus@vaadin.com>
Fri, 25 Apr 2014 13:58:53 +0000 (16:58 +0300)
committerVaadin Code Review <review@vaadin.com>
Fri, 16 May 2014 16:31:21 +0000 (16:31 +0000)
Change-Id: Ie666e2867908160b1544d3bf8251802ea771660f

client/src/com/vaadin/client/ui/VFilterSelect.java
uitest/src/com/vaadin/tests/components/ui/ComboboxStyleChangeWidthTest.java

index d21d5d20904ee844ff9d65343c95a1fec073cb49..cfa128fb15c5d2d0e2dd1484b718447fa36a99ff 100644 (file)
@@ -1950,7 +1950,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
              * wide.
              */
             int w = Util.getRequiredWidth(this);
-            if ((forceUpdate || !initDone || currentPage + 1 < 0)
+
+            if (forceUpdate || (!initDone || currentPage + 1 < 0)
                     && suggestionPopupMinWidth > w) {
                 /*
                  * We want to compensate for the paddings just to preserve the
index c0845cabb0e872d0c05179becf92385a776d2d5b..c8299c110e8acf38bae7c0da7ad27bab84966006 100644 (file)
@@ -18,9 +18,9 @@ package com.vaadin.tests.components.ui;
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
 
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.ComboBoxElement;
 import com.vaadin.tests.tb3.MultiBrowserTest;
 
 /**
@@ -36,11 +36,10 @@ public class ComboboxStyleChangeWidthTest extends MultiBrowserTest {
     public void testWidthRetained() {
         openTestURL();
 
-        WebElement comboBox = driver
-                .findElement(By.className("v-filterselect"));
+        ComboBoxElement comboBox = $(ComboBoxElement.class).first();
         String oldStyle = comboBox.getAttribute("style");
 
-        WebElement button = driver.findElement(By.className("v-button"));
+        ButtonElement button = $(ButtonElement.class).first();
         button.click();
         String newStyle = comboBox.getAttribute("style");