mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-12 10:12:17 +01:00
add virtualizer to ProjectTaskDropdown component to handle bigger
project lists
This commit is contained in:
@@ -18,3 +18,13 @@ window.getTimezoneSetting = vi.fn(() => 'UTC');
|
||||
window.getWeekStartSetting = vi.fn(() => 'monday');
|
||||
window.getNumberFormat = vi.fn(() => 'point');
|
||||
window.getIntervalFormat = vi.fn(() => 'hours-minutes');
|
||||
|
||||
// happy-dom has no layout engine, so every element reports offsetWidth/offsetHeight of 0.
|
||||
// TanStack Virtual (used by the project/task dropdown) measures via those properties, so
|
||||
// without a size it renders zero rows. Give elements a usable box so virtualized components
|
||||
// render their rows in component tests.
|
||||
Object.defineProperty(HTMLElement.prototype, 'offsetWidth', { configurable: true, get: () => 400 });
|
||||
Object.defineProperty(HTMLElement.prototype, 'offsetHeight', {
|
||||
configurable: true,
|
||||
get: () => 350,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user