diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-04-21 13:56:28 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-04-21 13:56:28 +0300 |
commit | 70a3a105b22a01ee1114b40e50c18cdd5b194e50 (patch) | |
tree | 7bfe9e04ba73df0ffe2e17f41821ebed4fc9a9df /uitest | |
parent | 973278ac4967996234006903f1838cc4d943f147 (diff) | |
download | vaadin-framework-70a3a105b22a01ee1114b40e50c18cdd5b194e50.tar.gz vaadin-framework-70a3a105b22a01ee1114b40e50c18cdd5b194e50.zip |
Fix race condition between rendering TreeGrid and setting up headers (#9105)
* Fix race condition between rendering Grid and setting up headers
* Remove Grid default headers when initializing the widget
* Fix header clean up, add null check to select all checkbox
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridNoHeaderOnInit.java | 23 | ||||
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridNoHeaderOnInitTest.java | 15 |
2 files changed, 38 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridNoHeaderOnInit.java b/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridNoHeaderOnInit.java new file mode 100644 index 0000000000..fa9ff25b45 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridNoHeaderOnInit.java @@ -0,0 +1,23 @@ +package com.vaadin.tests.components.treegrid; + +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Label; +import com.vaadin.ui.TreeGrid; +import com.vaadin.ui.renderers.ComponentRenderer; + +@Widgetset("com.vaadin.DefaultWidgetSet") +public class TreeGridNoHeaderOnInit extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + TreeGrid<String> grid = new TreeGrid<>(); + grid.addColumn(Object::toString).setCaption("toString with Caption"); + grid.addColumn(t -> new Label(t), new ComponentRenderer()); + grid.setItems("Foo", "Bar", "Baz"); + grid.removeHeaderRow(0); + grid.appendFooterRow(); + addComponent(grid); + } +} diff --git a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridNoHeaderOnInitTest.java b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridNoHeaderOnInitTest.java new file mode 100644 index 0000000000..c9463e519f --- /dev/null +++ b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridNoHeaderOnInitTest.java @@ -0,0 +1,15 @@ +package com.vaadin.tests.components.treegrid; + +import org.junit.Test; + +import com.vaadin.tests.tb3.SingleBrowserTest; + +public class TreeGridNoHeaderOnInitTest extends SingleBrowserTest { + + @Test + public void no_exception_thrown() { + setDebug(true); + openTestURL(); + assertNoErrorNotifications(); + } +} |