diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-07-01 14:27:30 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-07-02 12:19:42 +0000 |
commit | 22ea8caf78f6690ed4414bd0085af7c5bfc21e46 (patch) | |
tree | e3db86722c01d1eac9abac8331bb54504775636a /uitest | |
parent | bab0975e1288af9079780a030c439b0c2be832ac (diff) | |
download | vaadin-framework-22ea8caf78f6690ed4414bd0085af7c5bfc21e46.tar.gz vaadin-framework-22ea8caf78f6690ed4414bd0085af7c5bfc21e46.zip |
Fix Grid details on sort to display them on correct rows (#18224)
Due to the nature of Container this is only achieved by removing any
existing details and reopening those after the sort is done.
Change-Id: Ic42186ed85981d5dad4ff0948aa22f7a0404480d
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/GridDetailsWidthTest.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridDetailsWidthTest.java b/uitest/src/com/vaadin/tests/components/grid/GridDetailsWidthTest.java index 0a6f53820e..2def2d0279 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridDetailsWidthTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridDetailsWidthTest.java @@ -23,8 +23,11 @@ import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import com.vaadin.testbench.elements.GridElement; +import com.vaadin.testbench.elements.GridElement.GridCellElement; +import com.vaadin.testbench.parallel.TestCategory; import com.vaadin.tests.tb3.SingleBrowserTest; +@TestCategory("grid") public class GridDetailsWidthTest extends SingleBrowserTest { @Test @@ -64,4 +67,26 @@ public class GridDetailsWidthTest extends SingleBrowserTest { } } + @Test + public void testDetailsOnSort() { + openTestURL(); + GridElement grid = $(GridElement.class).first(); + + // Open a details rows + grid.getCell(0, 0).click(); + + GridCellElement cell = grid.getHeaderCell(0, 0); + cell.click(); + cell.click(); + + cell = grid.getCell(2, 0); + WebElement spacer = findElement(By.className("v-grid-spacer")); + Assert.assertEquals("Grid was not sorted correctly", "Hello 0", + cell.getText()); + Assert.assertEquals("Details row was not in correct location", cell + .getLocation().getY() + cell.getSize().getHeight(), spacer + .getLocation().getY()); + + } + } |