File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed
web/regression/javascript Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -66,21 +66,7 @@ document.createRange = () => {
6666 return range ;
6767} ;
6868
69- // for virtual tables, height should exist.
7069Element . prototype . getBoundingClientRect = jest . fn ( function ( ) {
71- if ( this . classList ?. contains ( 'pgrt' ) ) {
72- return {
73- width : 400 ,
74- height : 400 ,
75- top : 0 ,
76- left : 0 ,
77- bottom : 0 ,
78- right : 0 ,
79- x : 0 ,
80- y : 0 ,
81- toJSON : ( ) => { } ,
82- } ;
83- }
8470 return {
8571 width : 0 ,
8672 height : 0 ,
@@ -94,6 +80,16 @@ Element.prototype.getBoundingClientRect = jest.fn(function () {
9480 } ;
9581} ) ;
9682
83+
84+ // for virtual tables, height and width should exist.
85+ // https://github.com/TanStack/virtual/issues/641#issuecomment-2851908893
86+ Object . defineProperty ( HTMLElement . prototype , 'offsetHeight' , {
87+ value : 800
88+ } ) ;
89+ Object . defineProperty ( HTMLElement . prototype , 'offsetWidth' , {
90+ value : 800
91+ } ) ;
92+
9793Object . defineProperty ( global . SVGElement . prototype , 'getBBox' , {
9894 writable : true ,
9995 value : jest . fn ( ) . mockReturnValue ( {
You can’t perform that action at this time.
0 commit comments