@trackunit/react-test-setup 1.10.57 → 1.10.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -742,6 +742,7 @@ const setupResizeObserver = () => {
742
742
  }));
743
743
  };
744
744
 
745
+ const ITEM_SIZE = 40;
745
746
  /**
746
747
  * Mocks the @tanstack/react-virtual library for testing environments.
747
748
  *
@@ -770,11 +771,17 @@ const setupTanstackReactVirtual = () => {
770
771
  getVirtualItems: () => {
771
772
  const result = [];
772
773
  for (let i = 0; i < count; i++) {
773
- result.push({ index: i, start: i * 40, key: i, measureRef: () => { } });
774
+ result.push({ index: i, start: i * ITEM_SIZE, end: (i + 1) * ITEM_SIZE, size: ITEM_SIZE, lane: 0, key: i, measureRef: () => { } });
774
775
  }
775
776
  return result;
776
777
  },
777
- getTotalSize: () => count,
778
+ getTotalSize: () => count * ITEM_SIZE,
779
+ // Callback ref exposed by TanStack Virtual's directDomUpdates mode. The
780
+ // real one positions rows/sizes the container directly; the mock is a
781
+ // no-op so consumers can attach it without the virtualizer running.
782
+ containerRef: () => { },
783
+ scrollOffset: 0,
784
+ isScrolling: false,
778
785
  scrollToIndex: () => { },
779
786
  scrollToOffset: () => { },
780
787
  scrollToAlign: () => { },
package/index.esm.js CHANGED
@@ -721,6 +721,7 @@ const setupResizeObserver = () => {
721
721
  }));
722
722
  };
723
723
 
724
+ const ITEM_SIZE = 40;
724
725
  /**
725
726
  * Mocks the @tanstack/react-virtual library for testing environments.
726
727
  *
@@ -749,11 +750,17 @@ const setupTanstackReactVirtual = () => {
749
750
  getVirtualItems: () => {
750
751
  const result = [];
751
752
  for (let i = 0; i < count; i++) {
752
- result.push({ index: i, start: i * 40, key: i, measureRef: () => { } });
753
+ result.push({ index: i, start: i * ITEM_SIZE, end: (i + 1) * ITEM_SIZE, size: ITEM_SIZE, lane: 0, key: i, measureRef: () => { } });
753
754
  }
754
755
  return result;
755
756
  },
756
- getTotalSize: () => count,
757
+ getTotalSize: () => count * ITEM_SIZE,
758
+ // Callback ref exposed by TanStack Virtual's directDomUpdates mode. The
759
+ // real one positions rows/sizes the container directly; the mock is a
760
+ // no-op so consumers can attach it without the virtualizer running.
761
+ containerRef: () => { },
762
+ scrollOffset: 0,
763
+ isScrolling: false,
757
764
  scrollToIndex: () => { },
758
765
  scrollToOffset: () => { },
759
766
  scrollToAlign: () => { },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@trackunit/react-test-setup",
3
3
  "description": "Test setup utilities for React applications",
4
- "version": "1.10.57",
4
+ "version": "1.10.59",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
7
7
  "engines": {