diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2015-03-03 14:26:44 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2015-03-04 07:44:50 +0000 |
commit | 3abaa644d90c6460e6514b2e8207c178db01b52d (patch) | |
tree | bd329b68ec0ea817187c7d39217df470961ebb22 /uitest | |
parent | de2172eda96ca3f34b2ab4e2e926b13957c113de (diff) | |
download | vaadin-framework-3abaa644d90c6460e6514b2e8207c178db01b52d.tar.gz vaadin-framework-3abaa644d90c6460e6514b2e8207c178db01b52d.zip |
Take footer into account in column dnd-reorder (#16643)
Change-Id: I0358d1b18f65d40325b6c1bc3f3e4d3b9249fb5f
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnReorderTest.java | 75 |
1 files changed, 74 insertions, 1 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnReorderTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnReorderTest.java index 39c6082bed..a7fc3f435d 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnReorderTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnReorderTest.java @@ -236,7 +236,7 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { } @Test - public void testColumnReorder_cellInsideASpannedHeader_cantBeDroppedOutsideSpannedArea() { + public void testColumnReorder_cellInsideSpannedHeader_cantBeDroppedOutsideSpannedArea() { // given toggleColumnReorder(); selectMenuPath("Component", "Header", "Append row"); @@ -353,6 +353,79 @@ public class GridColumnReorderTest extends GridBasicClientFeaturesTest { assertColumnHeaderOrder(1, 3, 4, 5, 2); } + @Test + public void testColumnReorder_footerHasSpannedCells_cantDropInside() { + // given + toggleColumnReorder(); + selectMenuPath("Component", "Footer", "Append row"); + selectMenuPath("Component", "Footer", "Row 1", "Join columns 1, 2"); + assertColumnHeaderOrder(0, 1, 2, 3, 4); + + // when + dragAndDropColumnHeader(0, 3, 1, 80); + + // then + assertColumnHeaderOrder(0, 3, 1, 2, 4); + } + + @Test + public void testColumnReorder_cellInsideASpannedFooter_cantBeDroppedOutsideSpannedArea() { + // given + toggleColumnReorder(); + selectMenuPath("Component", "Footer", "Append row"); + selectMenuPath("Component", "Footer", "Row 1", "Join columns 1, 2"); + assertColumnHeaderOrder(0, 1, 2, 3, 4); + + // when + dragAndDropColumnHeader(0, 2, 0, 20); + + // then + assertColumnHeaderOrder(0, 2, 1, 3, 4); + } + + @Test + public void testColumnReorder_cellInsideTwoCrossingSpanningFooters_cantTouchThis() { + // given + toggleColumnReorder(); + selectMenuPath("Component", "Footer", "Append row"); + selectMenuPath("Component", "Footer", "Append row"); + selectMenuPath("Component", "Footer", "Row 1", "Join column cells 0, 1"); + selectMenuPath("Component", "Footer", "Row 2", "Join columns 1, 2"); + dragAndDropColumnHeader(0, 3, 0, 10); + assertColumnHeaderOrder(3, 0, 1, 2, 4); + + // when + dragAndDropColumnHeader(0, 2, 0, 10); + + // then + assertColumnHeaderOrder(3, 0, 1, 2, 4); + } + + @Test + public void testColumnReorder_cellsInsideTwoAdjacentSpannedHeaderAndFooter_reorderingLimited() { + // given + toggleColumnReorder(); + selectMenuPath("Component", "Header", "Append row"); + selectMenuPath("Component", "Footer", "Append row"); + selectMenuPath("Component", "Header", "Row 2", "Join columns 3, 4, 5"); + dragAndDropColumnHeader(0, 0, 4, 80); + scrollGridHorizontallyTo(0); + dragAndDropColumnHeader(0, 1, 4, 80); + scrollGridHorizontallyTo(0); + selectMenuPath("Component", "Footer", "Row 1", "Join columns 1, 2"); + assertColumnHeaderOrder(1, 3, 4, 5, 2); + + // when then + dragAndDropColumnHeader(0, 1, 3, 80); + assertColumnHeaderOrder(1, 4, 3, 5, 2); + + dragAndDropColumnHeader(0, 2, 4, 10); + assertColumnHeaderOrder(1, 4, 3, 5, 2); + + dragAndDropColumnHeader(0, 2, 0, 10); + assertColumnHeaderOrder(1, 3, 4, 5, 2); + } + private void toggleColumnReorder() { selectMenuPath("Component", "State", "Column Reordering"); } |