From ab07a2ef324c13614cea34bf2efd84aee75edcd0 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Fri, 19 Dec 2014 08:31:03 +0200 Subject: Fix cache updating in AbstractRemoteDataSource on row remove (#13334) Also contains a minor performance tweak for row adding in start of the cache and updates to cell focus logic. Change-Id: Ia64e43dd5ae8777014885b5e7dd05cb31b54eae2 --- .../basicfeatures/server/GridStructureTest.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java index 337293d687..d9d1acb4c1 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java @@ -382,6 +382,28 @@ public class GridStructureTest extends GridBasicFeaturesTest { assertEquals("Grid scrolled unexpectedly", cellContent, cell.getText()); } + @Test + public void testRemoveAndAddRowAboveViewport() { + setDebug(true); + openTestURL(); + + GridCellElement cell = getGridElement().getCell(500, 1); + String cellContent = cell.getText(); + selectMenuPath("Component", "Body rows", "Remove first row"); + + assertFalse("Error notification was present after removing row", + isElementPresent(NotificationElement.class)); + + assertEquals("Grid scrolled unexpectedly", cellContent, cell.getText()); + + selectMenuPath("Component", "Body rows", "Add first row"); + + assertFalse("Error notification was present after adding row", + isElementPresent(NotificationElement.class)); + + assertEquals("Grid scrolled unexpectedly", cellContent, cell.getText()); + } + private void assertPrimaryStylename(String stylename) { assertTrue(getGridElement().getAttribute("class").contains(stylename)); -- cgit v1.2.3