MOB-512 add map section tests

This commit is contained in:
sepeterson
2025-12-04 21:23:13 -06:00
parent f0e29b0440
commit 998f21a121

View File

@@ -97,4 +97,20 @@ describe( "SavedMatch", ( ) => {
const learnMoreButton = screen.queryByText( t( "LEARN-MORE-ABOUT-THIS-SPECIES" ) );
expect( learnMoreButton ).toBeFalsy( );
} );
it( "should not show map section for no latitude", async ( ) => {
renderAppWithComponent( <SavedMatchContainer observation={mockObservation} /> );
const mapSection = screen.queryByTestId( "MapSection" );
expect( mapSection ).toBeFalsy( );
} );
const mockObservationWithLatitude = factory( "LocalObservation", {
latitude: faker.location.latitude( )
} );
it( "should show map section when latitude is present", async ( ) => {
renderAppWithComponent( <SavedMatchContainer observation={mockObservationWithLatitude} /> );
const mapSection = screen.queryByTestId( "MapSection" );
expect( mapSection ).toBeTruthy( );
} );
} );