Bound continuous calendar event loading
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import {
|
||||
continuousEventWindow,
|
||||
continuousVirtualWindow,
|
||||
daysForMode,
|
||||
groupEventsByDay,
|
||||
layoutTimedEventsForDay,
|
||||
moveEventToDay,
|
||||
@@ -49,6 +51,23 @@ assert(
|
||||
"virtualization should preserve offscreen geometry",
|
||||
);
|
||||
|
||||
const continuousDays = daysForMode("continuous", focus, {
|
||||
before: 50,
|
||||
after: 50,
|
||||
});
|
||||
const eventWindow = continuousEventWindow(
|
||||
continuousDays,
|
||||
{ scrollTop: 40 * 92, height: 6 * 92 },
|
||||
);
|
||||
assert(
|
||||
(eventWindow.end.getTime() - eventWindow.start.getTime()) / 86_400_000 === 10 * 7,
|
||||
"continuous event loading should stay bounded to a ten-week window",
|
||||
);
|
||||
assert(
|
||||
eventWindow.start > continuousDays[0],
|
||||
"continuous event loading should follow the virtualized viewport",
|
||||
);
|
||||
|
||||
const day = new Date(2026, 6, 7);
|
||||
const parallel = [0, 1, 2, 3].map((index) =>
|
||||
event(
|
||||
|
||||
Reference in New Issue
Block a user