1
0
mirror of https://github.com/pavlobu/deskreen.git synced 2025-05-18 08:20:10 -07:00
deskreen/app/components/AllowConnectionForDeviceAlert.spec.tsx
2020-09-24 19:06:07 +03:00

26 lines
697 B
TypeScript

import React from 'react';
import Enzyme, { mount } from 'enzyme';
import EnzymeToJson from 'enzyme-to-json';
import Adapter from 'enzyme-adapter-react-16';
import { BrowserRouter as Router } from 'react-router-dom';
import AllowConnectionForDeviceAlert from './AllowConnectionForDeviceAlert';
Enzyme.configure({ adapter: new Adapter() });
jest.useFakeTimers();
it('should match exact snapshot', () => {
const subject = mount(
<>
<Router>
<AllowConnectionForDeviceAlert
device={{} as Device}
isOpen
onCancel={() => {}}
onConfirm={() => {}}
/>
</Router>
</>
);
expect(EnzymeToJson(subject)).toMatchSnapshot();
});