diff options
author | Adam Wagner <wbadam@users.noreply.github.com> | 2017-08-07 11:26:49 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-08-07 11:26:49 +0300 |
commit | d4fdcb9b469e64d58a0f8df4fd19b69fc515d8a4 (patch) | |
tree | 9caf220de6c310083d2c4ed2b2cbf27d994e69bd /server/src/test/java | |
parent | 3103ec62c8f258d7e9e4a9ac76ea42e1a0e7ca95 (diff) | |
download | vaadin-framework-d4fdcb9b469e64d58a0f8df4fd19b69fc515d8a4.tar.gz vaadin-framework-d4fdcb9b469e64d58a0f8df4fd19b69fc515d8a4.zip |
Fix moving child to first position in tree data (#9761)
Resolves #9760
Diffstat (limited to 'server/src/test/java')
-rw-r--r-- | server/src/test/java/com/vaadin/data/provider/TreeDataProviderTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/src/test/java/com/vaadin/data/provider/TreeDataProviderTest.java b/server/src/test/java/com/vaadin/data/provider/TreeDataProviderTest.java index 3ff94e9988..87b3ec0715 100644 --- a/server/src/test/java/com/vaadin/data/provider/TreeDataProviderTest.java +++ b/server/src/test/java/com/vaadin/data/provider/TreeDataProviderTest.java @@ -123,6 +123,19 @@ public class TreeDataProviderTest data.moveAfterSibling(root0, null); Assert.assertEquals(root0, data.getRootItems().get(0)); Assert.assertEquals(root9, data.getRootItems().get(9)); + + StrBean child0 = data.getChildren(root0).get(0); + StrBean child2 = data.getChildren(root0).get(2); + + // Move first child to different position + data.moveAfterSibling(child0, child2); + Assert.assertEquals(2, data.getChildren(root0).indexOf(child0)); + Assert.assertEquals(1, data.getChildren(root0).indexOf(child2)); + + // Move child back to first position + data.moveAfterSibling(child0, null); + Assert.assertEquals(0, data.getChildren(root0).indexOf(child0)); + Assert.assertEquals(2, data.getChildren(root0).indexOf(child2)); } @Test(expected = IllegalArgumentException.class) |