Skip to content

queryByText fails when component with icon is rendered #142

Closed
@mgenov

Description

@mgenov

Versions

"react": "16.8.6",
"react-dom": "16.8.6",
"react-native": "0.58.4",
"react-native-testing-library": "1.6.1",
"react-native-vector-icons": "6.0.2",

Description

The queryByText call fails when is rendered component with venctor icons:

 Cannot read property 'toString' of null

Reproducible Demo

import OctIcon from 'react-native-vector-icons/Octicons'
import { render } from 'react-native-testing-library'

it('crashes with error', () => {
    const { queryByText } = render(
      <View>
        <Text>Hello</Text>
        <OctIcon  name={'check'} />
      </View>
    )    
    expect(queryByText('Hello')).toBeTruthy()
})

-->

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions