press or type, use the
// you can omit the `on` prefix
await fireEvent(screen.getByPlaceholderText('my placeholder'), 'blur');
-FireEvent exposes convenience methods for common events like: press, changeText, scroll.
FireEvent exposes convenience methods for common events like: press, changeText, scroll, layout.
fireEvent.press
Use the User Event press() helper instead. It simulates press interactions more realistically, including pressable support.
fireEvent.layout+Available since React Native Testing Library 14.1.0.
Builds a layout event carrying the given layout rectangle and invokes the layout handler on the element or nearest eligible parent. Use it to simulate the layout engine measuring an element, e.g. to test components that adapt to a measured size.
The layout values are merged onto a zeroed rectangle ({ x: 0, y: 0, width: 0, height: 0 }), so pass only the fields your component reads.