diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-08-11 15:27:27 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-08-11 15:27:27 +0300 |
commit | bda7e54cb6eadddf07fb19d88479c642c4831a66 (patch) | |
tree | 4b88c87dd70733cf1c309630c8c2e0e8ca2ad15b /uitest | |
parent | 9a491b040d5c9d11e227acfdecfa867e5d7cf7d2 (diff) | |
download | vaadin-framework-bda7e54cb6eadddf07fb19d88479c642c4831a66.tar.gz vaadin-framework-bda7e54cb6eadddf07fb19d88479c642c4831a66.zip |
Provide API for setting row heights in Grid for different sections (#9810)
Fixes #9425
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java | 12 | ||||
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridRowHeightTest.java | 20 |
2 files changed, 32 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java index c5b6dbd490..21eb8b502a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java @@ -539,6 +539,10 @@ public class GridBasics extends AbstractTestUIWithLog { rowMenu.addItem("Deselect all", menuItem -> { grid.getSelectionModel().deselectAll(); }); + + MenuItem rowHeight = rowMenu.addItem("Body Row Height", null); + Stream.of(-1, 20, 50, 100).forEach(i -> rowHeight.addItem("" + i, + menuItem -> grid.setBodyRowHeight(i))); } private void createSelectionMenu(MenuItem stateItem) { @@ -640,6 +644,10 @@ public class GridBasics extends AbstractTestUIWithLog { headerMenu.addItem("Merge Header Cells [0,6..7]", menuItem -> { mergeHeaderСells(0, "6+7", 6, 7); }); + + MenuItem rowHeight = headerMenu.addItem("Header Row Height", null); + Stream.of(-1, 20, 50, 100).forEach(i -> rowHeight.addItem("" + i, + menuItem -> grid.setHeaderRowHeight(i))); } private void mergeHeaderСells(int rowIndex, String jointCellText, @@ -703,6 +711,10 @@ public class GridBasics extends AbstractTestUIWithLog { footerMenu.addItem("Merge Footer Cells [0,6..7]", menuItem -> { mergeFooterСells(0, "6+7", 6, 7); }); + + MenuItem rowHeight = footerMenu.addItem("Footer Row Height", null); + Stream.of(-1, 20, 50, 100).forEach(i -> rowHeight.addItem("" + i, + menuItem -> grid.setFooterRowHeight(i))); } /* DetailsGenerator related things */ diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridRowHeightTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridRowHeightTest.java index 73811bddc7..c99c31d4f7 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridRowHeightTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridRowHeightTest.java @@ -6,6 +6,26 @@ import org.junit.Test; public class GridRowHeightTest extends GridBasicsTest { @Test + public void testSeparateRowHeights() { + selectMenuPath("Component", "Footer", "Add default footer row"); + + int initialHeaderHeight = getHeaderHeight(); + + Assert.assertNotEquals("Header height should not be 50px initially", 50, + initialHeaderHeight); + + selectMenuPath("Component", "Body rows", "Body Row Height", "" + 100); + selectMenuPath("Component", "Header", "Header Row Height", "" + 20); + selectMenuPath("Component", "Footer", "Footer Row Height", "" + 50); + + checkRowHeights(20, 100, 50); + + selectMenuPath("Component", "Header", "Header Row Height", "" + -1); + + checkRowHeights(initialHeaderHeight, 100, 50); + } + + @Test public void testRowHeights() { selectMenuPath("Component", "Footer", "Add default footer row"); |