Skip to content

Commit 6610f53

Browse files
authored
test: fix virtualizer tests to pass with latest Firefox (#10334)
1 parent 1d20cf5 commit 6610f53

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/component-base/test/virtualizer-unlimited-size.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe('unlimited size', () => {
127127
it('should manually scroll to end after scroll to index', async () => {
128128
virtualizer.scrollToIndex(Math.floor(virtualizer.size / 2));
129129

130-
while (scrollTarget.scrollTop < scrollTarget.scrollHeight - scrollTarget.clientHeight) {
130+
while (Math.ceil(scrollTarget.scrollTop) < scrollTarget.scrollHeight - scrollTarget.clientHeight) {
131131
scrollTarget.scrollTop = scrollTarget.scrollHeight - scrollTarget.clientHeight;
132132
await oneEvent(scrollTarget, 'scroll');
133133
}
@@ -139,7 +139,7 @@ describe('unlimited size', () => {
139139
it('should manually scroll to end after scroll to start', async () => {
140140
virtualizer.scrollToIndex(0);
141141

142-
while (scrollTarget.scrollTop < scrollTarget.scrollHeight - scrollTarget.clientHeight) {
142+
while (Math.ceil(scrollTarget.scrollTop) < scrollTarget.scrollHeight - scrollTarget.clientHeight) {
143143
scrollTarget.scrollTop = scrollTarget.scrollHeight - scrollTarget.clientHeight;
144144
await oneEvent(scrollTarget, 'scroll');
145145
}
@@ -176,7 +176,7 @@ describe('unlimited size', () => {
176176
const elementCount = elementsContainer.children.length;
177177

178178
let largestIndex;
179-
while (scrollTarget.scrollTop < scrollTarget.scrollHeight - scrollTarget.clientHeight) {
179+
while (Math.ceil(scrollTarget.scrollTop) < scrollTarget.scrollHeight - scrollTarget.clientHeight) {
180180
largestIndex = Math.max(...Array.from(elementsContainer.children).map((el) => el.index));
181181

182182
scrollTarget.scrollTop += (elementHeight * elementCount) / 2;

0 commit comments

Comments
 (0)