mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
Add a unit test for when taxon is undefined
This commit is contained in:
@@ -275,6 +275,14 @@ describe( "DisplayTaxonName", ( ) => {
|
||||
} );
|
||||
} );
|
||||
|
||||
describe( "when taxon is undefined", ( ) => {
|
||||
it( "it displays fallback text", ( ) => {
|
||||
let taxon;
|
||||
render( <DisplayTaxonName taxon={taxon} /> );
|
||||
expect( screen.getByText( /Unknown/ ) ).toBeTruthy( );
|
||||
} );
|
||||
} );
|
||||
|
||||
describe( "when displayed as plain text within a Trans component", ( ) => {
|
||||
it( "it displays common name followed by scientific name", async ( ) => {
|
||||
render( <DisplayTaxonName taxon={subspeciesTaxon} removeStyling layout="horizontal" /> );
|
||||
|
||||
Reference in New Issue
Block a user