diff options
author | Henrik Paul <henrik@vaadin.com> | 2015-03-13 11:32:30 +0200 |
---|---|---|
committer | Henrik Paul <henrik@vaadin.com> | 2015-03-18 09:27:41 +0200 |
commit | 251ed2cbb633778d467e0a646ad6f87e3e8ca4bb (patch) | |
tree | ea3c269a17f98a335d7c3325abb88ca51556c8bb /uitest/src | |
parent | a1619ee73dc18eecda22056541826a3c8bb65a5c (diff) | |
download | vaadin-framework-251ed2cbb633778d467e0a646ad6f87e3e8ca4bb.tar.gz vaadin-framework-251ed2cbb633778d467e0a646ad6f87e3e8ca4bb.zip |
Fixes a bug in Details being open on freshly retrieved Grid rows (#16644)
Change-Id: Id337dd84ba0b0f09d55b3cdb0d8bfde67313ed21
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java index e9e32cb1ca..e9b5b688d1 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java @@ -17,7 +17,6 @@ package com.vaadin.tests.components.grid.basicfeatures.server; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -76,8 +75,7 @@ public class GridDetailsServerTest extends GridBasicFeaturesTest { selectMenuPath(FIRST_ITEM_DETAILS); selectMenuPath(FIRST_ITEM_DETAILS); - // this will throw before assertNull - assertNull(getGridElement().getDetails(0)); + getGridElement().getDetails(0); } @Test @@ -120,6 +118,31 @@ public class GridDetailsServerTest extends GridBasicFeaturesTest { details.findElement(By.className("v-widget"))); } + @Test(expected = NoSuchElementException.class) + public void scrollingDoesNotCreateAFloodOfDetailsRows() { + selectMenuPath(CUSTOM_DETAILS_GENERATOR); + + // scroll somewhere to hit uncached rows + getGridElement().scrollToRow(101); + + // this should throw + getGridElement().getDetails(100); + } + + @Test + public void openingDetailsOutOfView() { + getGridElement().scrollToRow(500); + + selectMenuPath(CUSTOM_DETAILS_GENERATOR); + selectMenuPath(FIRST_ITEM_DETAILS); + + getGridElement().scrollToRow(0); + + // if this fails, it'll fail before the assertNotNull + assertNotNull("unexpected null details row", getGridElement() + .getDetails(0)); + } + @Test public void togglingAVisibleDetailsRowWithOneRoundtrip() { selectMenuPath(CUSTOM_DETAILS_GENERATOR); |