You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+76-1Lines changed: 76 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ describe('Desktop specific tests', () => {
80
80
})
81
81
```
82
82
83
-
## Mock intersection observer
83
+
## Mock IntersectionObserver
84
84
85
85
Provides a way of triggering intersection observer events
86
86
@@ -121,6 +121,81 @@ Triggers the intersection observer callback for all of the observed nodes
121
121
and `isIntersected` set to `true` (for `enterAll`) or `false` (for `leaveAll`).
122
122
Other `IntersectionObserverEntry` params can be passed as `desc` argument
123
123
124
+
## Mock ResizeObserver
125
+
126
+
Provides a way of triggering resize observer events. It's up to you to mock elements' sizes. If your component uses `contentRect` provided by the callback, you must mock element's `getBoundingClientRect` (for exemple using a helper function `mockElementBoundingClientRect` provided by the lib)
127
+
128
+
_Currently the mock doesn't take into account multi-column layouts, so `borderBoxSize` and `contentBoxSize` will contain only one full-sized item_
0 commit comments