Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/svn/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Material ui 如何将数据testid添加到textField组件的错误字段_Material Ui_React Testing Library - Fatal编程技术网

Material ui 如何将数据testid添加到textField组件的错误字段

Material ui 如何将数据testid添加到textField组件的错误字段,material-ui,react-testing-library,Material Ui,React Testing Library,我试过这个 <TextInputField value={emailValue} error={emailError} errorProps={{ 'data-testid': 'emailError' }} helperText={emailError && 'Enter email address in format: yourname@example.com'} type='email' length={100} onChangeAction={setEmail} l

我试过这个

<TextInputField value={emailValue} error={emailError} errorProps={{ 'data-testid': 'emailError' }} helperText={emailError && 'Enter email address in format: yourname@example.com'} type='email' length={100} onChangeAction={setEmail} label='Email' />


但这并没有在错误字段上设置数据测试ID。

我必须将
FormHelperTextProps={{{'data testId':'emailError'}}}
而不是errorProps