UNPKG

@zohodesk/dot

Version:

In this Library, we Provide Some Basic Components to Build Your Application

93 lines 2.66 kB
import React from 'react'; import { render, cleanup } from '@testing-library/react'; import { setGlobalId } from '@zohodesk/components/es/Provider/IdProvider'; import VideoLookup from "../VideoLookup"; beforeEach(() => { setGlobalId(0); }); afterEach(() => { cleanup(); }); describe('VideoLookup', () => { test('rendering the defult props', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(VideoLookup, null)); expect(asFragment()).toMatchSnapshot(); }); test('rendering with prop isOpened', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(VideoLookup, { isOpened: true })); expect(asFragment()).toMatchSnapshot(); }); test('rendering with link', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(VideoLookup, { isOpened: true, link: "https://www.w3schools.com/html/mov_bbb.mp4" })); expect(asFragment()).toMatchSnapshot(); }); test('rendering with isEmbeddedLink is true', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(VideoLookup, { isOpened: true, isEmbeddedLink: true, link: "https://www.youtube.com/embed/mNJAvhOGa8M?si=-zIj_2o9dadadE_P" })); expect(asFragment()).toMatchSnapshot(); }); test('rendering with closeText', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(VideoLookup, { isOpened: true, closeText: "close" })); expect(asFragment()).toMatchSnapshot(); }); test('rendering with customStyle', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(VideoLookup, { isOpened: true, customStyle: { videoContainer: "customVideoContainer" } })); expect(asFragment()).toMatchSnapshot(); }); test('rendering with customId', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(VideoLookup, { customId: "radar_lookup", isOpened: true })); expect(asFragment()).toMatchSnapshot(); }); test('rendering with TestId', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(VideoLookup, { testId: "radar_lookup_text", isOpened: true })); expect(asFragment()).toMatchSnapshot(); }); test('rendering with videoFormat', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(VideoLookup, { videoFormat: "mp4", isOpened: true, link: "https://www.w3schools.com/html/mov_bbb.mp4" })); expect(asFragment()).toMatchSnapshot(); }); });