From 1f53dedbca452714a1381d83673611e702c668f9 Mon Sep 17 00:00:00 2001 From: nhussein11 Date: Sun, 6 Aug 2023 17:49:53 -0300 Subject: [PATCH] fix: volume video unit test --- src/lib/components/video/video.test.tsx | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/lib/components/video/video.test.tsx b/src/lib/components/video/video.test.tsx index 68980c8..8fba260 100644 --- a/src/lib/components/video/video.test.tsx +++ b/src/lib/components/video/video.test.tsx @@ -107,4 +107,46 @@ describe('IPFSVideo', () => { const loop = video?.getAttribute('loop') expect(loop).toBeDefined() }) + it('should render the IPFSVideo component with a gateway and a thumbnail and a loading component and muted and autoplay and loop and controls', () => { + render( + Loading...} + muted + loop + controls + />, + ) + const video = document.querySelector('video') + expect(video).toBeDefined() + const loading = screen.getByText('Loading...') + expect(loading).toBeDefined() + const muted = video?.getAttribute('muted') + expect(muted).toBeDefined() + const autoplay = video?.getAttribute('autoplay') + expect(autoplay).toBeDefined() + const loop = video?.getAttribute('loop') + expect(loop).toBeDefined() + const controls = video?.getAttribute('controls') + expect(controls).toBeDefined() + }) + it('should render the IPFSVideo component with specific volume', () => { + render( + Loading...} + muted + loop + controls + volume={0.5} + />, + ) + const video = document.querySelector('video') + expect(video).toBeDefined() + expect(video.volume).toBe(0.5) + }) })