Skip to content

[FEATURE] Support testId for testing purposes #204

@dr-thca

Description

@dr-thca

Problem

Since the component inherits the ViewProps it also inherits testId. But this prop is not usable in tests. I'm guessing this is because the component is mostly native

Solution

Either remove the prop from the types or do a hack that renders in react-native testing world.
I had to add a view around to check the existence of the component. Console.logging the toJSON representation will look like this, where the children is only "View".

    <View testID={testID('reel-loader-error-blurhash')} style={StyleSheet.absoluteFill}>
      <Blurhash
        blurhash={blurhash || 'L05X=N4n00~qD%9F%Mxu00%M-;IU'}
        style={StyleSheet.absoluteFill}
      />
    </View>
Image

Let me know if i'm just doing something wrong. That might be the case. Thanks for your work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions