diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2017-03-24 17:03:21 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2017-03-27 11:32:51 +0300 |
commit | fee9350a59c60aadb876bbdd8303552c1209c517 (patch) | |
tree | 1e3143a9820662bd5d68e576e49fd2171b28c144 /uitest | |
parent | 1e0661129b7c53704d088d2e1f7ea95630ca46b4 (diff) | |
download | vaadin-framework-fee9350a59c60aadb876bbdd8303552c1209c517.tar.gz vaadin-framework-fee9350a59c60aadb876bbdd8303552c1209c517.zip |
Added test for removing last row in cache
This is a test case for #8840 using TreeGrid.
Cannot be picked for 8.0.
Diffstat (limited to 'uitest')
2 files changed, 47 insertions, 1 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridBasicFeaturesTest.java b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridBasicFeaturesTest.java index bf373ccd2b..8f8a224049 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridBasicFeaturesTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridBasicFeaturesTest.java @@ -121,7 +121,7 @@ public class TreeGridBasicFeaturesTest extends MultiBrowserTest { @Override protected boolean useNativeEventsForIE() { - //Fixes IE11 selectMenuPath troubles + // Fixes IE11 selectMenuPath troubles return false; } diff --git a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridCollapseToLastRowInCacheTest.java b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridCollapseToLastRowInCacheTest.java new file mode 100644 index 0000000000..f24fcc2e76 --- /dev/null +++ b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridCollapseToLastRowInCacheTest.java @@ -0,0 +1,46 @@ +package com.vaadin.tests.components.treegrid; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import com.vaadin.testbench.elements.TreeGridElement; +import com.vaadin.tests.tb3.SingleBrowserTest; + +public class TreeGridCollapseToLastRowInCacheTest extends SingleBrowserTest { + + @Before + public void open() { + // need to remove more rows than what is in cache when collapsing + openTestURL("?restartApplication&debug&" + + TreeGridScrolling.NODES_PARAMETER + "=50"); + } + + @Override + protected Class<?> getUIClass() { + return TreeGridScrolling.class; + } + + // #8840 + @Test + public void testCollapsingNode_removesLastRowFromGridCache_noInternalError() { + TreeGridElement grid = $(TreeGridElement.class).first(); + + grid.expandWithClick(0); + grid.expandWithClick(1); + + assertNoErrorNotifications(); + + Assert.assertEquals("0 | 0", grid.getCell(0, 0).getText()); + Assert.assertEquals("1 | 0", grid.getCell(1, 0).getText()); + Assert.assertEquals("2 | 0", grid.getCell(2, 0).getText()); + + grid.collapseWithClick(0); + + Assert.assertEquals("0 | 0", grid.getCell(0, 0).getText()); + Assert.assertEquals("0 | 1", grid.getCell(1, 0).getText()); + + assertNoErrorNotifications(); + } + +} |