Skip to content

Commit c8ca6f7

Browse files
committed
fix: add small floating point tolerance as tests were failing in chromium
1 parent ac2d386 commit c8ca6f7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/spec/Extn-Tabbar-integ-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3044,8 +3044,8 @@ define(function (require, exports, module) {
30443044
wheelEventRight.originalEvent = { deltaY: 500 }; // Large scroll right
30453045
$tabBar.trigger(wheelEventRight);
30463046

3047-
// Should not exceed maximum scroll
3048-
expect($tabBar.scrollLeft()).toBeLessThanOrEqual(maxScrollLeft);
3047+
// Should not exceed maximum scroll (a small floating point tolerance)
3048+
expect($tabBar.scrollLeft()).toBeLessThanOrEqual(maxScrollLeft + 1);
30493049

30503050
// Scroll far to the left
30513051
$tabBar.scrollLeft(-1000); // Try to scroll beyond minimum
@@ -3055,8 +3055,8 @@ define(function (require, exports, module) {
30553055
wheelEventLeft.originalEvent = { deltaY: -500 }; // Large scroll left
30563056
$tabBar.trigger(wheelEventLeft);
30573057

3058-
// Should not go below 0
3059-
expect($tabBar.scrollLeft()).toBeGreaterThanOrEqual(0);
3058+
// Should not go below 0 (a small floating point tolerance)
3059+
expect($tabBar.scrollLeft()).toBeGreaterThanOrEqual(-1);
30603060
});
30613061
});
30623062
});

0 commit comments

Comments
 (0)