{t('general.loading.media', 'Loading media')}
diff --git a/ui/src/components/photoGallery/presentView/PresentMedia.test.tsx b/ui/src/components/photoGallery/presentView/PresentMedia.test.tsx
new file mode 100644
index 00000000..13aa5132
--- /dev/null
+++ b/ui/src/components/photoGallery/presentView/PresentMedia.test.tsx
@@ -0,0 +1,57 @@
+import '@testing-library/jest-dom'
+import { render, screen } from '@testing-library/react'
+
+import React from 'react'
+import { MediaType } from '../../../../__generated__/globalTypes'
+import PresentMedia, { PresentMediaProps_Media } from './PresentMedia'
+
+test('render present image', () => {
+ const media: PresentMediaProps_Media = {
+ __typename: 'Media',
+ id: '123',
+ type: MediaType.Photo,
+ highRes: null,
+ thumbnail: {
+ __typename: 'MediaURL',
+ url: '/sample_image.jpg',
+ },
+ }
+
+ render()
+
+ expect(screen.getByTestId('present-img-thumbnail')).toHaveAttribute(
+ 'src',
+ 'http://localhost/sample_image.jpg'
+ )
+ expect(screen.getByTestId('present-img-highres')).toHaveStyle({
+ display: 'none',
+ })
+})
+
+test('render present video', () => {
+ const media: PresentMediaProps_Media = {
+ __typename: 'Media',
+ id: '123',
+ type: MediaType.Video,
+ highRes: null,
+ videoWeb: {
+ __typename: 'MediaURL',
+ url: '/sample_video.mp4',
+ },
+ thumbnail: {
+ __typename: 'MediaURL',
+ url: '/sample_video_thumb.jpg',
+ },
+ }
+
+ render()
+
+ expect(screen.getByTestId('present-video')).toHaveAttribute(
+ 'poster',
+ 'http://localhost/sample_video_thumb.jpg'
+ )
+
+ expect(
+ screen.getByTestId('present-video').querySelector('source')
+ ).toHaveAttribute('src', 'http://localhost/sample_video.mp4')
+})
diff --git a/ui/src/components/photoGallery/presentView/PresentMedia.tsx b/ui/src/components/photoGallery/presentView/PresentMedia.tsx
index daa1f660..0076a097 100644
--- a/ui/src/components/photoGallery/presentView/PresentMedia.tsx
+++ b/ui/src/components/photoGallery/presentView/PresentMedia.tsx
@@ -48,10 +48,14 @@ const PresentMedia = ({
case MediaType.Photo:
return (
-
+
{
const elem = e.target as HTMLImageElement
elem.style.display = 'initial'
@@ -61,7 +65,7 @@ const PresentMedia = ({
)
case MediaType.Video:
- return
+ return
}
exhaustiveCheck(media.type)
diff --git a/ui/src/components/photoGallery/presentView/PresentNavigationOverlay.tsx b/ui/src/components/photoGallery/presentView/PresentNavigationOverlay.tsx
index e570a176..256e9109 100644
--- a/ui/src/components/photoGallery/presentView/PresentNavigationOverlay.tsx
+++ b/ui/src/components/photoGallery/presentView/PresentNavigationOverlay.tsx
@@ -94,6 +94,7 @@ const PresentNavigationOverlay = ({
return (
{
onMouseMove.current && onMouseMove.current()
}}