aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2014-12-09 14:53:27 +0200
committerHenrik Paul <henrik@vaadin.com>2014-12-10 08:32:18 +0000
commit8f52c9801589824a18a80ad6c03ae1312dbfd7fd (patch)
treec0d689c9a1661fbcfd6b70b5d5ec8548e70b05d2 /uitest/src
parente4ba60c26a6a9616c9dc1ba19e15896a5e24d1d9 (diff)
downloadvaadin-framework-8f52c9801589824a18a80ad6c03ae1312dbfd7fd.tar.gz
vaadin-framework-8f52c9801589824a18a80ad6c03ae1312dbfd7fd.zip
Remove selection column from single selection model (#13334)
This patch makes some changes to selection model logic and refactors the space selection handling from MultiSelectionRenderer to its own class. Change-Id: I5c4a7d68531a8b4f38991719ae54c9f87119e9a4
Diffstat (limited to 'uitest/src')
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java
index 8a76acb60b..a242ad1dd1 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java
@@ -150,7 +150,31 @@ public class GridSelectionTest extends GridBasicFeaturesTest {
assertTrue("Grid row 3 was not selected with space key.", grid
.getRow(3).isSelected());
+ }
+ @Test
+ public void testKeyboardWithSingleSelection() {
+ openTestURL();
+ setSelectionModelSingle();
+
+ GridElement grid = getGridElement();
+ grid.getCell(3, 1).click();
+ new Actions(getDriver()).sendKeys(Keys.SPACE).perform();
+
+ assertTrue("Grid row 3 was not selected with space key.", grid
+ .getRow(3).isSelected());
+
+ new Actions(getDriver()).sendKeys(Keys.SPACE).perform();
+
+ assertTrue("Grid row 3 was not deselected with space key.", !grid
+ .getRow(3).isSelected());
+
+ grid.scrollToRow(500);
+
+ new Actions(getDriver()).sendKeys(Keys.SPACE).perform();
+
+ assertTrue("Grid row 3 was not selected with space key.", grid
+ .getRow(3).isSelected());
}
@Test
@@ -194,6 +218,12 @@ public class GridSelectionTest extends GridBasicFeaturesTest {
"Check box shouldn't have been in header for Single Selection Model",
header.isElementPresent(By.tagName("input")));
+ // Single selection model shouldn't have selection column to begin with
+ assertFalse(
+ "Selection columnn shouldn't have been in grid for Single Selection Model",
+ getGridElement().getCell(0, 1).isElementPresent(
+ By.tagName("input")));
+
setSelectionModelNone();
header = getGridElement().getHeaderCell(0, 0);
assertFalse(