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:
@@ -35,9 +35,9 @@ describe( "PhotosSection", () => {
|
||||
);
|
||||
|
||||
await waitFor( () => {
|
||||
expect( screen.getByTestId( "MatchScreen.ObsPhoto" ) ).toBeTruthy();
|
||||
expect( screen.getByTestId( "MatchScreen.ObsPhoto" ) ).toBeVisible();
|
||||
} );
|
||||
expect( screen.getByText( "3" ) ).toBeTruthy();
|
||||
expect( screen.getByText( "3" ) ).toBeVisible();
|
||||
} );
|
||||
|
||||
it( "hides taxon photos when hideTaxonPhotos is true", async () => {
|
||||
@@ -49,7 +49,7 @@ describe( "PhotosSection", () => {
|
||||
);
|
||||
|
||||
await waitFor( () => {
|
||||
expect( screen.getByTestId( "MatchScreen.ObsPhoto" ) ).toBeTruthy();
|
||||
expect( screen.getByTestId( "MatchScreen.ObsPhoto" ) ).toBeVisible();
|
||||
} );
|
||||
expect( screen.queryByTestId( "TaxonDetails.photo.1" ) ).toBeFalsy();
|
||||
expect( screen.queryByTestId( "TaxonDetails.photo.4" ) ).toBeFalsy();
|
||||
@@ -65,7 +65,7 @@ describe( "PhotosSection", () => {
|
||||
);
|
||||
|
||||
await waitFor( () => {
|
||||
expect( screen.getByTestId( "TaxonDetails.photo.2" ) ).toBeTruthy();
|
||||
expect( screen.getByTestId( "TaxonDetails.photo.2" ) ).toBeVisible();
|
||||
} );
|
||||
expect( screen.queryByTestId( "TaxonDetails.photo.1" ) ).toBeFalsy();
|
||||
} ); */
|
||||
@@ -78,7 +78,7 @@ describe( "PhotosSection", () => {
|
||||
);
|
||||
|
||||
await waitFor( () => {
|
||||
expect( screen.getByTestId( "TaxonDetails.photo.4" ) ).toBeTruthy();
|
||||
expect( screen.getByTestId( "TaxonDetails.photo.4" ) ).toBeVisible();
|
||||
} );
|
||||
|
||||
const photoButton = screen.getByTestId( "TaxonDetails.photo.4" );
|
||||
@@ -96,10 +96,10 @@ describe( "PhotosSection", () => {
|
||||
|
||||
// Representative photo + 2 more = 3 total
|
||||
await waitFor( () => {
|
||||
expect( screen.getByTestId( "TaxonDetails.photo.4" ) ).toBeTruthy();
|
||||
expect( screen.getByTestId( "TaxonDetails.photo.4" ) ).toBeVisible();
|
||||
} );
|
||||
expect( screen.getByTestId( "TaxonDetails.photo.1" ) ).toBeTruthy();
|
||||
expect( screen.getByTestId( "TaxonDetails.photo.2" ) ).toBeTruthy();
|
||||
expect( screen.getByTestId( "TaxonDetails.photo.1" ) ).toBeVisible();
|
||||
expect( screen.getByTestId( "TaxonDetails.photo.2" ) ).toBeVisible();
|
||||
expect( screen.queryByTestId( "TaxonDetails.photo.3" ) ).toBeFalsy();
|
||||
} );
|
||||
} );
|
||||
|
||||
@@ -13,8 +13,8 @@ describe( "PreMatchLoadingScreen", () => {
|
||||
it( "shows loading screen when isLoading is true", () => {
|
||||
renderComponent( <PreMatchLoadingScreen isLoading /> );
|
||||
|
||||
expect( screen.getByText( "Analyzing for the best identification..." ) ).toBeTruthy();
|
||||
expect( screen.getByText( "Analyzing for the best identification..." ) ).toBeVisible();
|
||||
// Find activity indicator
|
||||
expect( screen.getByRole( "progressbar" ) ).toBeTruthy();
|
||||
expect( screen.getByRole( "progressbar" ) ).toBeVisible();
|
||||
} );
|
||||
} );
|
||||
|
||||
@@ -10,7 +10,7 @@ describe( "SaveDiscardButtons", () => {
|
||||
renderComponent( <SaveDiscardButtons handlePress={mockHandlePress} /> );
|
||||
|
||||
const saveButton = screen.getByText( "SAVE" );
|
||||
expect( saveButton ).toBeTruthy();
|
||||
expect( saveButton ).toBeVisible();
|
||||
fireEvent.press( saveButton );
|
||||
|
||||
expect( mockHandlePress ).toHaveBeenCalledWith( "save" );
|
||||
@@ -22,7 +22,7 @@ describe( "SaveDiscardButtons", () => {
|
||||
renderComponent( <SaveDiscardButtons handlePress={mockHandlePress} /> );
|
||||
|
||||
const discardButton = screen.getByText( "DISCARD" );
|
||||
expect( discardButton ).toBeTruthy();
|
||||
expect( discardButton ).toBeVisible();
|
||||
fireEvent.press( discardButton );
|
||||
|
||||
expect( mockHandlePress ).toHaveBeenCalledWith( "discard" );
|
||||
|
||||
Reference in New Issue
Block a user