diff options
author | Henri Sara <henri.sara@gmail.com> | 2017-06-28 11:35:35 +0300 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2017-06-28 11:35:35 +0300 |
commit | 29a4578a8d52c0720ff16cedf783223fdc4ea533 (patch) | |
tree | f7b37914a805c451f7a9273df0ac627a25b1171e /server/src/test/java | |
parent | 6ed5f2a0df068dba713d8e24dc9f78e2a0829a73 (diff) | |
download | vaadin-framework-29a4578a8d52c0720ff16cedf783223fdc4ea533.tar.gz vaadin-framework-29a4578a8d52c0720ff16cedf783223fdc4ea533.zip |
Add isExpanded() method to Tree and TreeGrid
Fixes #9595
Diffstat (limited to 'server/src/test/java')
-rw-r--r-- | server/src/test/java/com/vaadin/tests/components/TreeTest.java | 5 | ||||
-rw-r--r-- | server/src/test/java/com/vaadin/tests/components/treegrid/TreeGridTest.java | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/server/src/test/java/com/vaadin/tests/components/TreeTest.java b/server/src/test/java/com/vaadin/tests/components/TreeTest.java index 9224934a4c..c4ee9ae3d5 100644 --- a/server/src/test/java/com/vaadin/tests/components/TreeTest.java +++ b/server/src/test/java/com/vaadin/tests/components/TreeTest.java @@ -56,8 +56,7 @@ public class TreeTest { treeData.addItem(null, "Foo"); treeData.addItem("Foo", "Bar"); treeData.addItem("Foo", "Baz"); - tree.setDataProvider( - new TreeDataProvider<>(treeData)); + tree.setDataProvider(new TreeDataProvider<>(treeData)); TreeCollapseExpandListener listener = new TreeCollapseExpandListener( tree); @@ -66,9 +65,11 @@ public class TreeTest { Assert.assertFalse(listener.isExpanded()); tree.expand("Foo"); + Assert.assertTrue("Item not expanded", tree.isExpanded("Foo")); Assert.assertTrue("Expand event not fired", listener.isExpanded()); Assert.assertFalse(listener.isCollapsed()); tree.collapse("Foo"); + Assert.assertFalse("Item not collapsed", tree.isExpanded("Foo")); Assert.assertTrue("Collapse event not fired", listener.isCollapsed()); } diff --git a/server/src/test/java/com/vaadin/tests/components/treegrid/TreeGridTest.java b/server/src/test/java/com/vaadin/tests/components/treegrid/TreeGridTest.java index 1f900688c4..fdaacae48b 100644 --- a/server/src/test/java/com/vaadin/tests/components/treegrid/TreeGridTest.java +++ b/server/src/test/java/com/vaadin/tests/components/treegrid/TreeGridTest.java @@ -35,11 +35,13 @@ public class TreeGridTest { // Test expand event Assert.assertFalse(expandEventFired); treeGrid.expand("Foo"); + Assert.assertTrue("Item not expanded", treeGrid.isExpanded("Foo")); Assert.assertTrue("Expand event not fired", expandEventFired); // Test collapse event Assert.assertFalse(collapseEventFired); treeGrid.collapse("Foo"); + Assert.assertFalse("Item not collapsed", treeGrid.isExpanded("Foo")); Assert.assertTrue("Collapse event not fired", collapseEventFired); } } |