react-video-thumbnail-image
Version:
Create a thumbnail image of video by providing any url.
18 lines (13 loc) • 667 B
JavaScript
import React from 'react';
import Enzyme, { shallow, mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import VideoImageThumbnail from '../src/index';
Enzyme.configure({ adapter: new Adapter() });
const VIDEO_URL = 'https://dl.dropboxusercontent.com/s/pkz1yguv8vcs7k1/cover.mp4?dl=0';
test('it should render', () => {
const thumbCmp = mount(<VideoImageThumbnail videoUrl={VIDEO_URL} width={1} height={1} />);
expect(thumbCmp.find('.react-video-thumbnail').length).toBe(1);
console.log({ state: thumbCmp.state() })
const { dataLoaded, metaLoaded, seeked, suspended } = thumbCmp.state();
// expect(dataLoaded).toBe(true);
})