@shellygo/cypress-test-utils - v2.0.57 / Modules / CypressReactComponentHelper
Classdes
CypressReactComponentHelper exposes the following public properties:
• new CypressReactComponentHelper()
• Private
component: ReactNode
• get: Object
enables getting the mounted component
Name | Type |
---|---|
component |
() => ReactNode |
component: () => ReactNode
Get mounted component
• when: Object
enables mounting of a React component
Name | Type |
---|---|
mount |
<P, T>(type : string | T , props? : null | Attributes & P , ...children : ReactNode []) => void |
mountComponent |
(component : ReactNode ) => void |
mount: <P, T>(type
: string
| T
, props?
: null
| Attributes
& P
, ...children
: ReactNode
[]) => void
Mount a react component
Example
reactComponentHelper.when.mount(typeof MyComponent, { prop1: "value1" }, <MyChildComponent />);
mountComponent: (component
: ReactNode
) => void
Mount a react component
Example
reactComponentHelper.when.mountComponent(<MyComponent />);