Module: Wrapper

For tests, this will be wrapped around each list of rendered components resulting from a call to find. This allows for exposing additional test helping code.

Methods


at(index)

Returns the item at the specified index in the tree

Parameters:
Name Type Description
index number

The index to pull from

Returns:

A component Test Wrapper, null if not found

Type
Wrapper | null

find(elementOrComponent)

Will search the rendered tree for a tag name or a component name.

Parameters:
Name Type Description
elementOrComponent Component | string

A String DOM name or Component

Returns:

A wrapper containing the results of the search.

Type
ArrayWrapper

find(elementOrComponent)

Will search the rendered tree for a tag name or a component name.

Parameters:
Name Type Description
elementOrComponent Component | string

A String DOM name or Component

Returns:

A wrapper containing the results of the search.

Type
ArrayWrapper

first()

Returns the first item in the tree

Returns:

A component Test Wrapper, null if none

Type
Wrapper | null

last()

Returns the last item in the tree

Returns:

A component Test Wrapper, null if none

Type
Wrapper | null

text()

Will find all text in the tree and return a flattened version of it.

Returns:

All of the text contained in the tree

Type
string

text()

Will find all text in the tree and return a flattened version of it.

Returns:

All of the text contained in the tree

Type
string

Module: Wrapper

For tests, this will be wrapped around each rendered component. This allows for exposing additional test helping code.

Methods


at(index)

Returns the item at the specified index in the tree

Parameters:
Name Type Description
index number

The index to pull from

Returns:

A component Test Wrapper, null if not found

Type
Wrapper | null

find(elementOrComponent)

Will search the rendered tree for a tag name or a component name.

Parameters:
Name Type Description
elementOrComponent Component | string

A String DOM name or Component

Returns:

A wrapper containing the results of the search.

Type
ArrayWrapper

find(elementOrComponent)

Will search the rendered tree for a tag name or a component name.

Parameters:
Name Type Description
elementOrComponent Component | string

A String DOM name or Component

Returns:

A wrapper containing the results of the search.

Type
ArrayWrapper

first()

Returns the first item in the tree

Returns:

A component Test Wrapper, null if none

Type
Wrapper | null

last()

Returns the last item in the tree

Returns:

A component Test Wrapper, null if none

Type
Wrapper | null

text()

Will find all text in the tree and return a flattened version of it.

Returns:

All of the text contained in the tree

Type
string

text()

Will find all text in the tree and return a flattened version of it.

Returns:

All of the text contained in the tree

Type
string