-
Notifications
You must be signed in to change notification settings - Fork 728
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve caching when expanding nodes in hierarchical data (#8902)
Fixes #8790
- Loading branch information
1 parent
e905e2b
commit 0bee1dc
Showing
4 changed files
with
223 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridExpandDataRequestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.vaadin.tests.components.treegrid; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import com.vaadin.testbench.elements.TreeGridElement; | ||
import com.vaadin.tests.tb3.SingleBrowserTest; | ||
|
||
public class TreeGridExpandDataRequestTest extends SingleBrowserTest { | ||
|
||
@Override | ||
protected Class<?> getUIClass() { | ||
return TreeGridBasicFeatures.class; | ||
} | ||
|
||
TreeGridElement grid; | ||
|
||
@Before | ||
public void before() { | ||
openTestURL(); | ||
grid = $(TreeGridElement.class).first(); | ||
selectMenuPath("Component", "Features", "Set data provider", | ||
"LoggingDataProvider"); | ||
clearLog(); | ||
} | ||
|
||
private void clearLog() { | ||
selectMenuPath("Settings", "Clear log"); | ||
} | ||
|
||
@Test | ||
public void expand_node0_does_not_request_root_nodes() { | ||
grid.expandWithClick(0); | ||
Assert.assertFalse("Log should not contain request for root nodes.", | ||
logContainsText("Root node request: ")); | ||
} | ||
|
||
@Test | ||
public void expand_node0_after_node1_does_not_request_children_of_node1() { | ||
grid.expandWithClick(1); | ||
Assert.assertFalse("Log should not contain request for root nodes.", | ||
logContainsText("Root node request: ")); | ||
clearLog(); | ||
grid.expandWithClick(0); | ||
Assert.assertFalse( | ||
"Log should not contain request for children of '0 | 1'.", | ||
logContainsText("Children request: 0 | 1")); | ||
Assert.assertFalse("Log should not contain request for root nodes.", | ||
logContainsText("Root node request: ")); | ||
} | ||
} |