diff options
author | Leif Åstrand <leif@vaadin.com> | 2014-12-31 13:03:03 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-12-31 11:28:48 +0000 |
commit | 956a7fdaa73ea3850a2f402b5563911e8d81ea39 (patch) | |
tree | 754d7294b4b332ac24db3692bdd089a1a85e5aa6 /uitest | |
parent | 47850591adc8f2510ce18b64862c6fefd1f247ad (diff) | |
download | vaadin-framework-956a7fdaa73ea3850a2f402b5563911e8d81ea39.tar.gz vaadin-framework-956a7fdaa73ea3850a2f402b5563911e8d81ea39.zip |
Change selection model before selecting rows (#15488)
Change-Id: I2697367626ca0b469e06e3707a3868f4abfdddd9
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/SelectDuringInit.java | 40 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/SelectDuringInitTest.java | 35 |
2 files changed, 75 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/SelectDuringInit.java b/uitest/src/com/vaadin/tests/components/grid/SelectDuringInit.java new file mode 100644 index 0000000000..d8394acd19 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/grid/SelectDuringInit.java @@ -0,0 +1,40 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.grid; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Grid; +import com.vaadin.ui.Grid.SelectionMode; + +public class SelectDuringInit extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Grid grid = new Grid(); + grid.setSelectionMode(SelectionMode.MULTI); + + grid.addColumn("value"); + grid.addRow("row 1"); + grid.addRow("row 2"); + grid.addRow("row 3"); + + grid.select(Integer.valueOf(2)); + + addComponent(grid); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/grid/SelectDuringInitTest.java b/uitest/src/com/vaadin/tests/components/grid/SelectDuringInitTest.java new file mode 100644 index 0000000000..edfc8031a8 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/grid/SelectDuringInitTest.java @@ -0,0 +1,35 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.grid; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.testbench.elements.GridElement; +import com.vaadin.tests.tb3.SingleBrowserTest; + +public class SelectDuringInitTest extends SingleBrowserTest { + + @Test + public void testSelectDuringInit() { + openTestURL(); + + GridElement grid = $(GridElement.class).first(); + + Assert.assertTrue(grid.getRow(1).isSelected()); + } + +} |