Skip to main content

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

NameType
Textends ScenePart

Parameters

NameTypeDescription
nodeElementThe React node to render
partDefinitionsTThe 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

NameType
Textends ScenePart

Parameters

NameTypeDescription
rootElementHTMLElementThe React node to render
partDefinitionsTThe 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

NameType
Textends ScenePart

Parameters

NameTypeDescription
rootElementHTMLElementThe React node to render
partDefinitionsTThe 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

NameType
Textends ScenePart

Parameters

NameTypeDescription
nodeElementThe React node to render
partDefinitionsTThe scene part definitions
option?Readonly<Partial<IReactTestEngineOption>>-

Returns

TestEngine<T>

The test engine

Defined in

react/src/createTestEngine.ts:24