Module: @atomic-testing/react
Interfaces
Functions
createLegacyTestEngine
▸ createLegacyTestEngine<T
>(node
, partDefinitions
, option?
): TestEngine
<T
>
Create test engine for React 17 or before, for React 18 or later, use createTestEngine This function takes a react node and render it into a container element. For rendered components, use createRenderedLegacyTestEngine
Type parameters
Name | Type |
---|---|
T | extends ScenePart |
Parameters
Name | Type | Description |
---|---|---|
node | Element | The React node to render |
partDefinitions | T | The scene part definitions |
option? | Readonly <Partial <IReactTestEngineOption >> | - |
Returns
TestEngine
<T
>
The test engine
Defined in
react/src/createLegacyTestEngine.ts:24
createRenderedLegacyTestEngine
▸ createRenderedLegacyTestEngine<T
>(rootElement
, partDefinitions
, _option?
): TestEngine
<T
>
Create test engine for React 17 or before, for React 18 or later, use createRenderedTestEngine This function takes an html element purportedly rendered by React and create a test engine for it, it can be useful in environment such as Storybook where Storybook renders the component and the test
Type parameters
Name | Type |
---|---|
T | extends ScenePart |
Parameters
Name | Type | Description |
---|---|---|
rootElement | HTMLElement | The React node to render |
partDefinitions | T | The scene part definitions |
_option? | Readonly <Partial <IReactTestEngineOption >> | - |
Returns
TestEngine
<T
>
The test engine
Defined in
react/src/createLegacyTestEngine.ts:64
createRenderedTestEngine
▸ createRenderedTestEngine<T
>(rootElement
, partDefinitions
, _option?
): TestEngine
<T
>
Create test engine for React 18 or later, for React 17 or before, use createRenderedLegacyTestEngine This function takes an html element purportedly rendered by React and create a test engine for it, it can be useful in environment such as Storybook where Storybook renders the component and the test
Type parameters
Name | Type |
---|---|
T | extends ScenePart |
Parameters
Name | Type | Description |
---|---|---|
rootElement | HTMLElement | The React node to render |
partDefinitions | T | The scene part definitions |
_option? | Readonly <Partial <IReactTestEngineOption >> | - |
Returns
TestEngine
<T
>
The test engine
Defined in
react/src/createTestEngine.ts:64
createTestEngine
▸ createTestEngine<T
>(node
, partDefinitions
, option?
): TestEngine
<T
>
Create test engine for React 18 or later, for React 17 or before, use createLegacyTestEngine This function takes a react node and render it into a container element. For rendered components, use createRenderedTestEngine
Type parameters
Name | Type |
---|---|
T | extends ScenePart |
Parameters
Name | Type | Description |
---|---|---|
node | Element | The React node to render |
partDefinitions | T | The scene part definitions |
option? | Readonly <Partial <IReactTestEngineOption >> | - |
Returns
TestEngine
<T
>
The test engine