summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorPekka Hyvönen <pekka@vaadin.com>2015-05-06 14:09:40 +0300
committerPekka Hyvönen <pekka@vaadin.com>2015-05-06 14:49:16 +0300
commitb22cf5257b9b890d5d529fa091d1bd3e67bbf43d (patch)
tree941d1f3f7b2755132636d60af7bfcd55569b6d1a /uitest
parentebc8fa602ec1cf54234b1df630d900eb87b3991a (diff)
downloadvaadin-framework-b22cf5257b9b890d5d529fa091d1bd3e67bbf43d.tar.gz
vaadin-framework-b22cf5257b9b890d5d529fa091d1bd3e67bbf43d.zip
Hiding/Unhiding Grid column when details row is open (#17691)
Fixes paintRemoveColumns and paintInsertColumns in Escalator.AbstractStaticRowContainer to not include spacers in row count. Fixes couple ColumnHidingTests for IE8. Change-Id: I283ee9fcdf0f3a7d0019948a700225c27a25d701
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java35
1 files changed, 32 insertions, 3 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java
index b446bdef48..c4ad2ea347 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertTrue;
import java.util.List;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -818,6 +819,27 @@ public class GridColumnHidingTest extends GridBasicClientFeaturesTest {
verifyHeaderCellColspan(1, 4, 1);
}
+ @Test
+ public void testColumnHiding_detailsRowIsOpen_renderedCorrectly() {
+ selectMenuPath("Component", "Row details", "Toggle details for...",
+ "Row 1");
+ assertColumnHeaderOrder(0, 1, 2, 3, 4);
+ Assert.assertNotNull("Details not found", getGridElement()
+ .getDetails(1));
+
+ toggleHideColumnAPI(0);
+
+ assertColumnHeaderOrder(1, 2, 3, 4);
+ Assert.assertNotNull("Details not found", getGridElement()
+ .getDetails(1));
+
+ toggleHideColumnAPI(0);
+
+ assertColumnHeaderOrder(0, 1, 2, 3, 4);
+ Assert.assertNotNull("Details not found", getGridElement()
+ .getDetails(1));
+ }
+
private void loadSpannedCellsFixture() {
selectMenuPath("Component", "State", "Width", "1000px");
appendHeaderRow();
@@ -854,9 +876,16 @@ public class GridColumnHidingTest extends GridBasicClientFeaturesTest {
}
private void verifyHeaderCellColspan(int row, int column, int colspan) {
- assertEquals(Integer.valueOf(colspan), Integer.valueOf(Integer
- .parseInt(getGridElement().getHeaderCell(row, column)
- .getAttribute("colspan"))));
+ try {
+ assertEquals(Integer.valueOf(colspan), Integer.valueOf(Integer
+ .parseInt(getGridElement().getHeaderCell(row, column)
+ .getAttribute("colspan"))));
+ } catch (NumberFormatException nfe) {
+ // IE8 has colSpan
+ assertEquals(Integer.valueOf(colspan), Integer.valueOf(Integer
+ .parseInt(getGridElement().getHeaderCell(row, column)
+ .getAttribute("colSpan"))));
+ }
}
private void verifyNumberOfCellsInHeader(int row, int numberOfCells) {