summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-07-19 09:34:05 +0300
committerHenri Sara <henri.sara@gmail.com>2017-07-19 09:34:05 +0300
commite8f7de722a7561e25c6bfd1fb007f498db22b1c7 (patch)
treeb66b761eea0c5386f4c8c0112e278f140e08ce6d /uitest
parentce566c57fa7a020d654b9bdc7c885f8874148aa1 (diff)
downloadvaadin-framework-8.1.0.rc2.tar.gz
vaadin-framework-8.1.0.rc2.zip
Allow null Components in ComponentRenderer (#9692)8.1.0.rc2
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java3
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java16
2 files changed, 19 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java
index 6398ef1055..e1bf0f354a 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java
@@ -45,6 +45,9 @@ public class GridComponents extends AbstractTestUIWithLog {
return textField;
}).setId("textField").setCaption("TextField");
grid.addColumn(string -> {
+ if (string.contains("30")) {
+ return null;
+ }
Button button = new Button("Click Me!",
e -> Notification.show(
"Clicked button on row for: " + string,
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java
index 295f06e4ce..70966b373e 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java
@@ -1,5 +1,8 @@
package com.vaadin.tests.components.grid;
+import java.util.stream.IntStream;
+import java.util.stream.Stream;
+
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.WebElement;
@@ -99,6 +102,13 @@ public class GridComponentsTest extends MultiBrowserTest {
}
@Test
+ public void testRow30() {
+ openTestURL();
+ Stream.of(30, 130, 230, 330).forEach(this::assertNoButton);
+ IntStream.range(300, 310).forEach(this::assertNoButton);
+ }
+
+ @Test
public void testHeaders() {
openTestURL();
GridElement grid = $(GridElement.class).first();
@@ -118,4 +128,10 @@ public class GridComponentsTest extends MultiBrowserTest {
$(NotificationElement.class).first().getText()
.contains(string));
}
+
+ private void assertNoButton(int i) {
+ GridRowElement row = $(GridElement.class).first().getRow(i);
+ Assert.assertFalse("Row " + i + " should not have a button",
+ row.getCell(2).isElementPresent(ButtonElement.class));
+ }
}