Skip to content

Commit 100f687

Browse files
authored
Add additional validation for Virtualization test (#26904)
* Add additional validation for Virtualization test * Update VirtualizationTest.cs
1 parent b0247cc commit 100f687

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Components/test/E2ETest/Tests/VirtualizationTest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ public void CanUseViewportAsContainer()
208208

209209
Browser.ExecuteJavaScript("window.scrollTo(0, document.body.scrollHeight);");
210210

211+
// Validate that the scroll event completed successfully
212+
var lastElement = Browser.Exists(By.Id("999"));
213+
Browser.True(() => lastElement.Displayed);
214+
211215
// Validate that the top spacer has expanded.
212216
Browser.NotEqual(expectedInitialSpacerStyle, () => topSpacer.GetAttribute("style"));
213217
}

src/Components/test/testassets/BasicTestApp/VirtualizationComponent.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<p id="viewport-as-root">
3232
Viewport as root:<br />
3333
<Virtualize Items="@fixedItems" ItemSize="itemSize">
34-
<div @key="context" style="height: @(itemSize)px; background-color: rgb(@((context % 2) * 255), @((1-(context % 2)) * 255), 255);">Item @context</div>
34+
<div @key="context" id="@context" style="height: @(itemSize)px; background-color: rgb(@((context % 2) * 255), @((1-(context % 2)) * 255), 255);">Item @context</div>
3535
</Virtualize>
3636
</p>
3737

0 commit comments

Comments
 (0)