MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Test

Function Test

packages/react-aria-components/test/TextField.test.js:308–323  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

306 it('resets to defaultValue when submitting form action', async () => {
307 const Component = component;
308 function Test() {
309 const [value, formAction] = React.useActionState(
310 (_, formData) => formData.get('value'),
311 'initial'
312 );
313
314 return (
315 <form action={formAction}>
316 <TextField defaultValue={value} name="value">
317 <Label>Value</Label>
318 <Component data-testid="input" />
319 </TextField>
320 <input data-testid="submit" type="submit" />
321 </form>
322 );
323 }
324
325 const {getByTestId} = render(<Test />);
326 const input = getByTestId('input');

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected