| 107 | } |
| 108 | |
| 109 | observe(target: Element) { |
| 110 | // Store for later triggering |
| 111 | resizeObservers.push({ |
| 112 | callback: this.callback, |
| 113 | observer: this, |
| 114 | target, |
| 115 | }); |
| 116 | |
| 117 | // Call callback synchronously for predictable testing |
| 118 | const mockEntry = { |
| 119 | target, |
| 120 | contentRect: { |
| 121 | width: 1024, |
| 122 | height: 768, |
| 123 | top: 0, |
| 124 | left: 0, |
| 125 | bottom: 768, |
| 126 | right: 1024, |
| 127 | x: 0, |
| 128 | y: 0, |
| 129 | toJSON: () => ({}), |
| 130 | }, |
| 131 | borderBoxSize: [], |
| 132 | contentBoxSize: [], |
| 133 | devicePixelContentBoxSize: [], |
| 134 | } as unknown as ResizeObserverEntry; |
| 135 | |
| 136 | // Call callback synchronously |
| 137 | this.callback([mockEntry], this); |
| 138 | } |
| 139 | |
| 140 | unobserve() { |
| 141 | // Mock implementation |