-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add test for Flow issue #19006 #6164
Conversation
grid.setPageSize(10); | ||
grid.addHierarchyColumn(String::toString).setHeader("Item"); | ||
|
||
var data = new TreeData<String>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm inclined to recommend this alternative test setup – it reproduces the issue in a way that is less likely to be affected by future refactorings:
- Expand All
- Scroll to 0-250
- Scroll to start
TreeGrid grid = new TreeGrid<String>();
grid.setPageSize(10);
grid.addHierarchyColumn(String::toString).setHeader("Item");
var data = new TreeData<String>();
for (int i = 0; i < 500; i++) {
data.addRootItems("Item-" + i);
}
for (int i = 0; i < 500; i++) {
data.addItems("Item-0", "Item-0-" + i);
}
for (int j = 0; j < 500; j++) {
data.addItems("Item-0-0", "Item-0-0-" + j);
}
grid.setDataProvider(new TreeDataProvider<>(data));
add(grid);
add(new NativeButton("Expand all",
e -> grid.expandRecursively(data.getRootItems(), 1)));
add(new NativeButton("Scroll to 0-250",
e -> grid.scrollToIndex(0, 250)));
add(new NativeButton("Scroll to start",
e -> grid.scrollToStart()));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified the test as recommended. Also added id checks in every step of the test.
...ration-tests/src/test/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysIT.java
Outdated
Show resolved
Hide resolved
...ration-tests/src/test/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysIT.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart from the unused imports.
...tion-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysPage.java
Outdated
Show resolved
Hide resolved
...tion-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysPage.java
Outdated
Show resolved
Hide resolved
...tion-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysPage.java
Outdated
Show resolved
Hide resolved
…/main/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysPage.java
…/main/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysPage.java
…/main/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysPage.java
…/test/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysIT.java
…/test/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysIT.java
9dfd13c
to
2fb5999
Compare
Quality Gate passedIssues Measures |
* test: add test for Flow issue #19006 * change test as recommended in review * Update vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysPage.java * Update vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysPage.java * Update vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysPage.java * Update vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/test/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysIT.java * Update vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/test/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysIT.java --------- Co-authored-by: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com>
* test: add test for Flow issue #19006 * change test as recommended in review * Update vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysPage.java * Update vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysPage.java * Update vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysPage.java * Update vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/test/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysIT.java * Update vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/test/java/com/vaadin/flow/component/treegrid/it/TreeGridExpandedKeysIT.java --------- Co-authored-by: Teppo Kurki <teppo.kurki@vaadin.com> Co-authored-by: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com>
Test for vaadin/flow#19006