mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
MOB-722: toBeVisible
This commit is contained in:
@@ -27,7 +27,7 @@ describe( "AdditionalSuggestionsScroll", () => {
|
||||
onSuggestionChosen={jest.fn()}
|
||||
/>
|
||||
);
|
||||
expect( screen.getByRole( "progressbar" ) ).toBeTruthy();
|
||||
expect( screen.getByRole( "progressbar" ) ).toBeVisible();
|
||||
} );
|
||||
|
||||
it( "renders heading when noTopSuggestion is true", () => {
|
||||
@@ -47,6 +47,6 @@ describe( "AdditionalSuggestionsScroll", () => {
|
||||
/>
|
||||
);
|
||||
|
||||
expect( screen.getByText( "It might be one of these" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "It might be one of these" ) ).toBeVisible();
|
||||
} );
|
||||
} );
|
||||
|
||||
@@ -14,7 +14,7 @@ describe( "EmptyMapSection", () => {
|
||||
);
|
||||
|
||||
const locationIndicator = screen.getByTestId( "Map.LocationIndicator" );
|
||||
expect( locationIndicator ).toBeTruthy();
|
||||
expect( locationIndicator ).toBeVisible();
|
||||
} );
|
||||
|
||||
it( "calls handleAddLocationPressed when button is pressed", () => {
|
||||
|
||||
@@ -25,8 +25,8 @@ describe( "IconicSuggestion", () => {
|
||||
it( "renders taxon with common name and scientific name", () => {
|
||||
renderComponent( <IconicSuggestion taxon={mockTaxon} /> );
|
||||
|
||||
expect( screen.getByText( "Ray-finned Fishes" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "actinopterygii" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "Ray-finned Fishes" ) ).toBeVisible();
|
||||
expect( screen.getByText( "actinopterygii" ) ).toBeVisible();
|
||||
} );
|
||||
|
||||
it( "calls handlePress when pressed", () => {
|
||||
@@ -52,8 +52,8 @@ describe( "IconicSuggestion", () => {
|
||||
|
||||
renderComponent( <IconicSuggestion taxon={mockTaxon} fromLocal /> );
|
||||
|
||||
expect( screen.getByText( "Birds" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "Aves" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "Birds" ) ).toBeVisible();
|
||||
expect( screen.getByText( "Aves" ) ).toBeVisible();
|
||||
} );
|
||||
|
||||
it( "handles taxon without common name", () => {
|
||||
@@ -69,6 +69,6 @@ describe( "IconicSuggestion", () => {
|
||||
|
||||
renderComponent( <IconicSuggestion taxon={taxonWithoutCommonName} /> );
|
||||
|
||||
expect( screen.getByText( "Mollusca" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "Mollusca" ) ).toBeVisible();
|
||||
} );
|
||||
} );
|
||||
|
||||
@@ -20,7 +20,7 @@ describe( "MatchHeader", () => {
|
||||
|
||||
renderComponent( <MatchHeader topSuggestion={topSuggestion} /> );
|
||||
|
||||
expect( screen.getByText( "You observed this species" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "You observed this species" ) ).toBeVisible();
|
||||
} );
|
||||
|
||||
it( "displays high confidence message for taxa above species", () => {
|
||||
@@ -31,9 +31,9 @@ describe( "MatchHeader", () => {
|
||||
|
||||
renderComponent( <MatchHeader topSuggestion={topSuggestion} /> );
|
||||
|
||||
expect( screen.getByText( "You observed a species in this group" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "95%" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "Confidence" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "You observed a species in this group" ) ).toBeVisible();
|
||||
expect( screen.getByText( "95%" ) ).toBeVisible();
|
||||
expect( screen.getByText( "Confidence" ) ).toBeVisible();
|
||||
} );
|
||||
|
||||
it( "displays likely confidence message for species", () => {
|
||||
@@ -44,7 +44,7 @@ describe( "MatchHeader", () => {
|
||||
|
||||
renderComponent( <MatchHeader topSuggestion={topSuggestion} /> );
|
||||
|
||||
expect( screen.getByText( "You likely observed this species" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "You likely observed this species" ) ).toBeVisible();
|
||||
} );
|
||||
|
||||
it( "displays may have observed message", () => {
|
||||
@@ -55,7 +55,7 @@ describe( "MatchHeader", () => {
|
||||
|
||||
renderComponent( <MatchHeader topSuggestion={topSuggestion} /> );
|
||||
|
||||
expect( screen.getByText( "You may have observed this species" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "You may have observed this species" ) ).toBeVisible();
|
||||
} );
|
||||
|
||||
it( "hides observation status when hideObservationStatus is true", () => {
|
||||
|
||||
@@ -25,10 +25,10 @@ describe( "SuggestionsResult", () => {
|
||||
/>
|
||||
);
|
||||
|
||||
expect( screen.getByText( "Cup Plant" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "Silphium perfoliatum" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "87% confidence" ) ).toBeTruthy();
|
||||
expect( screen.getByTestId( "SuggestionsResult.745.photo" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "Cup Plant" ) ).toBeVisible();
|
||||
expect( screen.getByText( "Silphium perfoliatum" ) ).toBeVisible();
|
||||
expect( screen.getByText( "87% confidence" ) ).toBeVisible();
|
||||
expect( screen.getByTestId( "SuggestionsResult.745.photo" ) ).toBeVisible();
|
||||
} );
|
||||
|
||||
it( "handles non valid Realm taxon and returns null", () => {
|
||||
|
||||
Reference in New Issue
Block a user