summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2015-07-05 21:17:25 +0300
committerVaadin Code Review <review@vaadin.com>2015-07-07 17:09:11 +0000
commitd2c3e30f20e7566c34f0ee775d68b809583328b4 (patch)
treeb08eb3df9cb38e0972fe818ce2c3f562921fcabf /uitest
parent61fe18d7771b378bc5c5211276489127c35c96ee (diff)
downloadvaadin-framework-d2c3e30f20e7566c34f0ee775d68b809583328b4.tar.gz
vaadin-framework-d2c3e30f20e7566c34f0ee775d68b809583328b4.zip
Ensure correct render of selection when changing selection model (#17087)
Change-Id: I79547b32a7b7bec0ea2b327ceb0b69c756e2e812
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridClientSelectionTest.java13
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSelectionTest.java16
2 files changed, 29 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridClientSelectionTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridClientSelectionTest.java
index a341e39b74..d1d7b21e11 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridClientSelectionTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridClientSelectionTest.java
@@ -195,4 +195,17 @@ public class GridClientSelectionTest extends GridBasicClientFeaturesTest {
isRowSelected(1));
}
+ @Test
+ public void testChangeSelectionModelUpdatesUI() {
+ openTestURL();
+
+ setSelectionModelSingle(true);
+ getGridElement().getCell(5, 1).click();
+ assertTrue("Row 5 should be selected after clicking", isRowSelected(5));
+ setSelectionModelNone();
+ assertFalse(
+ "Row 5 should not be selected after changing selection model",
+ isRowSelected(5));
+
+ }
}
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 74972fe4d2..9953bbcae0 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
@@ -319,6 +319,22 @@ public class GridSelectionTest extends GridBasicFeaturesTest {
.isSelected());
}
+ @Test
+ public void testChangeSelectionModelUpdatesUI() {
+ openTestURL();
+
+ setSelectionModelSingle();
+
+ getGridElement().getCell(5, 1).click();
+ assertTrue("Row should be selected after clicking", getRow(5)
+ .isSelected());
+
+ setSelectionModelNone();
+ assertFalse(
+ "Row should not be selected after changing selection model",
+ getRow(5).isSelected());
+ }
+
private void setSelectionModelMulti() {
selectMenuPath("Component", "State", "Selection mode", "multi");
}