Skip to content

@shellygo/cypress-test-utils - v4.1.3 / Modules / CypressReactComponentHelper

Class: CypressReactComponentHelper

Classdes

CypressReactComponentHelper exposes the following public properties:

Table of contents

Constructors

Properties

Constructors

constructor

new CypressReactComponentHelper()

Properties

get

get: Object

enables getting the mounted component

Type declaration

Name Type
component () => ReactNode

component: () => ReactNode

Get mounted component



when

when: Object

enables mounting of a React component

Type declaration

Name Type
mount (type: string \| T, props?: null \| Attributes & P, ...children: ReactNode[]) => void
mountComponent (component: ReactNode) => void

mount: (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 />);