MOB-722: toBeVisible

This commit is contained in:
sepeterson
2025-12-18 10:34:31 -06:00
parent 8839c21c3a
commit 722edb2928
3 changed files with 12 additions and 12 deletions

View File

@@ -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();
} );
} );

View File

@@ -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();
} );
} );

View File

@@ -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" );