React-native-testing-library: Invariant Violation: Unable to find node on an unmounted component. When Using fireEvent.press

Created on 18 Nov 2019  路  1Comment  路  Source: callstack/react-native-testing-library

Unable to find node on an unmounted component.

I am getting this error when I try to press my TouchableOpacity component on my tests. My test looks like this:

const [manaColorCheckbox, manaIndentityCheckbox] = getAllByText(
      WHITE_MANA_COLOR_CHECKBOX_TEXT,
    );
    fireEvent.changeText(searchCardInput, SEARCH_INPUT);
    fireEvent.press(searchButton);
    fireEvent.press(manaColorCheckbox);
    fireEvent.press(manaIndentityCheckbox);

image

https://github.com/mtg-community/trading-card-manager/blob/bc99849b3f66596af97ce49ef309139376ff920d/packages/frontend/src/presentation/screens/__tests__/cardSearchFilter.test.tsx#L153-L205

Can someone help me?

question

Most helpful comment

@LeoMosiah were you able to solve this ?

>All comments

@LeoMosiah were you able to solve this ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benmonro picture benmonro  路  6Comments

thymikee picture thymikee  路  9Comments

bitttttten picture bitttttten  路  9Comments

aleclarson picture aleclarson  路  7Comments

acollazomayer picture acollazomayer  路  3Comments