diff --git a/src/components/Match/PhotosSection.js b/src/components/Match/PhotosSection.js index a0cdba8f5..4ce61b4f8 100644 --- a/src/components/Match/PhotosSection.js +++ b/src/components/Match/PhotosSection.js @@ -1,3 +1,5 @@ +// @flow + import classnames from "classnames"; import MediaViewerModal from "components/MediaViewer/MediaViewerModal"; import { @@ -7,6 +9,7 @@ import { Image, Pressable, View } from "components/styledComponents"; import _, { compact } from "lodash"; +import type { Node } from "react"; import React, { useEffect, useState } from "react"; import Photo from "realmModels/Photo"; import getImageDimensions from "sharedHelpers/getImageDimensions"; @@ -25,7 +28,7 @@ const PhotosSection = ( { obsPhotos, navToTaxonDetails, hideTaxonPhotos -}: Props ) => { +}: Props ): Node => { const [displayPortraitLayout, setDisplayPortraitLayout] = useState( null ); const [mediaViewerVisible, setMediaViewerVisible] = useState( false ); diff --git a/src/components/ObsDetailsDefaultMode/SavedMatch/SavedMatchHeaderRight.tsx b/src/components/ObsDetailsDefaultMode/SavedMatch/SavedMatchHeaderRight.tsx index 6dd80b44d..d99040d3b 100644 --- a/src/components/ObsDetailsDefaultMode/SavedMatch/SavedMatchHeaderRight.tsx +++ b/src/components/ObsDetailsDefaultMode/SavedMatch/SavedMatchHeaderRight.tsx @@ -25,7 +25,6 @@ const SavedMatchHeaderRight = ( { ( ) => ( navigateToObsEdit( observation )} icon="pencil" color={String( colors?.darkGray )} diff --git a/tests/unit/components/DisplayTaxonName.test.js b/tests/unit/components/DisplayTaxonName.test.js index 9c12ce97f..4bd9e45e0 100644 --- a/tests/unit/components/DisplayTaxonName.test.js +++ b/tests/unit/components/DisplayTaxonName.test.js @@ -275,6 +275,14 @@ describe( "DisplayTaxonName", ( ) => { } ); } ); + describe( "when taxon is undefined", ( ) => { + it( "it displays fallback text", ( ) => { + let taxon; + render( ); + 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( );