aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2020-07-23 13:27:11 +0300
committerGitHub <noreply@github.com>2020-07-23 13:27:11 +0300
commit17baaf01b7d5b942856f5be8ba21f3c2918b45e5 (patch)
tree66f9d43ba06b1b9b65740b889ce6c99818521272 /uitest
parenta17348081abf87cb0d42bef4ae4faac3c8fd6c72 (diff)
downloadvaadin-framework-17baaf01b7d5b942856f5be8ba21f3c2918b45e5.tar.gz
vaadin-framework-17baaf01b7d5b942856f5be8ba21f3c2918b45e5.zip
Add column width recalculation when vertical scrollbar hidden/shown. (#12058)
- If the Grid has any columns with non-fixed widths, the presence of a vertical scrollbar affects the column width calculations. Horizontal scrollbar should only be shown when actually needed.
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/grid/GridSizeChange.java6
-rw-r--r--uitest/src/test/java/com/vaadin/tests/VerifyBrowserVersionTest.java2
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/GridSizeChangeTest.java6
3 files changed, 10 insertions, 4 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSizeChange.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSizeChange.java
index b677cee903..3628c4adaf 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSizeChange.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSizeChange.java
@@ -26,7 +26,7 @@ public class GridSizeChange extends AbstractTestUI {
protected void setup(VaadinRequest request) {
grid = new Grid<>();
data = new ArrayList<>();
- for (int i = 0; i < 10; ++i) {
+ for (int i = 0; i < 8; ++i) {
data.add(i);
++counter;
}
@@ -39,8 +39,8 @@ public class GridSizeChange extends AbstractTestUI {
// set height mode and height
grid.setHeightMode(HeightMode.ROW);
- grid.setHeightByRows(10);
- grid.setWidth(90, Unit.PIXELS);
+ grid.setHeightByRows(8);
+ grid.setWidth(100, Unit.PIXELS);
// create a tabsheet with one tab and place grid inside
VerticalLayout tab = new VerticalLayout();
diff --git a/uitest/src/test/java/com/vaadin/tests/VerifyBrowserVersionTest.java b/uitest/src/test/java/com/vaadin/tests/VerifyBrowserVersionTest.java
index 4fc4106bde..c259e34837 100644
--- a/uitest/src/test/java/com/vaadin/tests/VerifyBrowserVersionTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/VerifyBrowserVersionTest.java
@@ -25,7 +25,7 @@ public class VerifyBrowserVersionTest extends MultiBrowserTest {
// Chrome version does not necessarily match the desired version
// because of auto updates...
browserIdentifier = getExpectedUserAgentString(
- getDesiredCapabilities()) + "83";
+ getDesiredCapabilities()) + "84";
} else if (BrowserUtil.isFirefox(getDesiredCapabilities())) {
browserIdentifier = getExpectedUserAgentString(
getDesiredCapabilities()) + "75";
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSizeChangeTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSizeChangeTest.java
index 3b8e485ed9..48a56b5291 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSizeChangeTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSizeChangeTest.java
@@ -41,23 +41,27 @@ public class GridSizeChangeTest extends MultiBrowserTest {
assertGridWithinTabSheet();
ensureVerticalScrollbar(true);
+ ensureHorizontalScrollbar(false);
$(ButtonElement.class).caption("Remove row").first().click();
// height matches rows -> no scrollbar
assertGridWithinTabSheet();
ensureVerticalScrollbar(false);
+ ensureHorizontalScrollbar(false);
$(ButtonElement.class).caption("Reduce width").first().click();
// column too wide -> scrollbar
assertGridWithinTabSheet();
+ ensureVerticalScrollbar(false);
ensureHorizontalScrollbar(true);
$(ButtonElement.class).caption("Increase width").first().click();
// column fits -> no scrollbar
assertGridWithinTabSheet();
+ ensureVerticalScrollbar(false);
ensureHorizontalScrollbar(false);
$(ButtonElement.class).caption("Add row").first().click();
@@ -65,12 +69,14 @@ public class GridSizeChangeTest extends MultiBrowserTest {
assertGridWithinTabSheet();
ensureVerticalScrollbar(true);
+ ensureHorizontalScrollbar(false);
$(ButtonElement.class).caption("Increase height").first().click();
// height matches rows -> no scrollbar
assertGridWithinTabSheet();
ensureVerticalScrollbar(false);
+ ensureHorizontalScrollbar(false);
}
private void ensureVerticalScrollbar(boolean displayed) {