0

I am testing a form component in my cypress ionic component test, the form relies on text and setText props which are provided by the page, which is to say there is no state handled by the component itself only the page, how can I recreate the state normaly provided in the context of a component test, Thank you

<SmartTextField
  text={""}
  setText={(text: string) => {
    // output of typing
  }}
/>;

I have tried to add useState but get the error Cannot read properties of null (reading 'useState')

Ahmed Sbai
  • 10,695
  • 9
  • 19
  • 38
Murchy Man
  • 31
  • 1
  • 1
  • 3
  • You need to inspect the generated html output using web-developer toolbar and write cypress code for that. – art Feb 08 '23 at 04:08

0 Answers0