summaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2020-03-09 16:54:13 +0200
committerGitHub <noreply@github.com>2020-03-09 16:54:13 +0200
commit932bc470aee35fd80afd5bb9054b4392948dccb3 (patch)
treeb2e39498f0420c280f04334cd2397b249dc16bb2 /uitest/src/test/java/com/vaadin/tests
parent3397e396dcebb797006f1c4ae8186ea0d422a5f7 (diff)
downloadvaadin-framework-932bc470aee35fd80afd5bb9054b4392948dccb3.tar.gz
vaadin-framework-932bc470aee35fd80afd5bb9054b4392948dccb3.zip
Trigger re-measure after updating ElementResizeListeners. (#11912)
Removing ElementResizeListeners from an element makes it unmeasurable and clears any saved measured values. Adding the listeners back makes the element measurable again but doesn't add it to measuring queue. Measuring needs to happen or any updates to expanded components within a layout (without changes that would trigger full re-measuring of the layout itself) lead to broken expand size calculations with any fixed size elements assumed to have no size. Fixes #10734
Diffstat (limited to 'uitest/src/test/java/com/vaadin/tests')
-rw-r--r--uitest/src/test/java/com/vaadin/tests/layouts/UpdateComponentWithinExpandRatioTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/layouts/UpdateComponentWithinExpandRatioTest.java b/uitest/src/test/java/com/vaadin/tests/layouts/UpdateComponentWithinExpandRatioTest.java
new file mode 100644
index 0000000000..5c28799ba7
--- /dev/null
+++ b/uitest/src/test/java/com/vaadin/tests/layouts/UpdateComponentWithinExpandRatioTest.java
@@ -0,0 +1,29 @@
+package com.vaadin.tests.layouts;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.ProgressBarElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class UpdateComponentWithinExpandRatioTest extends MultiBrowserTest {
+
+ @Test
+ public void updateProgressShouldNotMoveButton() {
+ openTestURL();
+ ProgressBarElement pb = $(ProgressBarElement.class).first();
+ ButtonElement button = $(ButtonElement.class).first();
+
+ int initialX = button.getLocation().getX();
+ int initialWidth = pb.getSize().getWidth();
+
+ button.click();
+
+ assertEquals("Button's position changed unexpectedly", initialX,
+ button.getLocation().getX());
+ assertEquals("ProgressBar's width changed unexpectedly", initialWidth,
+ pb.getSize().getWidth());
+ }
+}