-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat: use web components 21.0.0-alpha2, fix tests #978
Conversation
35a72b4
to
2684934
Compare
Remaining failures:
And the one about
|
Few other failures:
|
f730e4d
to
a2f0932
Compare
2dcf077
to
4035eb2
Compare
verifyRows(1501); | ||
verifyRows(1800); | ||
|
||
setEstimate(1600); | ||
verifyRows(1600); | ||
setEstimate(1700); | ||
verifyRows(1700); |
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.
The previous tests were written with the assumption that the scrollToIndex wouldn't continue to the desired index once the last scrollable index before increasing the range has been reached. This works as expected with the new version so the grid actually ends up at index 1500 after scrollToRow(1500)
, even if the effective size is increased dynamically.
int expectedLastItem = 517; | ||
int VIEWPORT_ITEM_CAPACITY = 16; | ||
int expectedLastItem = 500 + VIEWPORT_ITEM_CAPACITY; |
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.
Assert.assertEquals(999, grid.getLastVisibleRowIndex()); | ||
Assert.assertEquals(1000 + VIEWPORT_ITEM_CAPACITY, grid.getLastVisibleRowIndex()); |
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.
String slotName = vgcc.getAttribute("slot") | ||
.replace("vaadin-grid-cell-content-", ""); | ||
if (Integer.parseInt(slotName) <= 180) { | ||
TestBenchElement slot = vgcc.getPropertyElement("assignedSlot"); | ||
if (headerSlots.contains(slot) || bodySlots.contains(slot)) { |
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.
This test relied the cell content elements in the light DOM belonging to body and header starting from an arbitrary index 180.
waitUntil(driver -> getCells(grid).stream() | ||
.filter(cell -> text.equals(cell.getText())).findFirst() | ||
.isPresent()); | ||
waitUntil(driver -> { | ||
List<?> cellContentTexts = (List<?>) getCommandExecutor() | ||
.executeScript( | ||
"return Array.from(arguments[0].querySelectorAll('vaadin-grid-cell-content')).map(cell => cell.textContent)", | ||
grid); | ||
return cellContentTexts.contains(text); | ||
}); |
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.
For some reason getting the cells via Selenium API resulted in different set than what querySelectorAll returns. Fixed to use pure JS approach instead.
"return arguments[0]._firstVisibleIndex+arguments[0]._vidxOffset", | ||
grid); | ||
"return arguments[0]._firstVisibleIndex", grid); |
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.
_vidxOffset
is now a concept inside the virtualizer and doesn't concern grid. Now _firstVisibleIndex
includes the offset value (it's still not public API!)
SonarQube analysis reported 222 issues Top 10 issues
|
Description
@vaadin/vaadin-template-renderer
to bring back removed Polymer template APIs.