Check out example codes for "react testing library Property 'value' does not exist on type 'HTMLElement'.ts(2339)". It will help you in understanding the concepts better.

Code Example 1

const title = getByPlaceholderText("test") as HTMLInputElement;

Learn ReactJs, React Native from akashmittal.com