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

Function example

packages/react-aria-components/test/Tree.test.tsx:3031–3048  ·  view source on GitHub ↗
(label: string)

Source from the content-addressed store, hash-verified

3029 let onBlur = jest.fn();
3030 let onFocusChange = jest.fn();
3031 let example = (label: string) => (
3032 <Tree aria-label="Test" defaultExpandedKeys={['projects']}>
3033 <TreeItem
3034 id="projects"
3035 textValue={label}
3036 onFocus={onFocus}
3037 onBlur={onBlur}
3038 onFocusChange={onFocusChange}>
3039 <TreeItemContent>
3040 <Button slot="chevron">Expand</Button>
3041 {label}
3042 </TreeItemContent>
3043 <TreeItem id="project-1" textValue="Project 1">
3044 <TreeItemContent>Project 1</TreeItemContent>
3045 </TreeItem>
3046 </TreeItem>
3047 </Tree>
3048 );
3049 let {rerender, getAllByRole} = render(example('Projects'));
3050 await user.tab();
3051 let rows = getAllByRole('row');

Callers 2

Tree.test.tsxFile · 0.70
ExpandableCodeFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected