import { code } from 'dashboard/generated/controlplane';
import * as _ from 'lodash';
import * as React from 'react';
import * as Renderer from 'react-test-renderer';
import { RegisterTargetModal } from './component';

import twirp = code.justin.tv.eventbus.controlplane;

jest.mock('react-dom', () => ({
  // tslint:disable-next-line:no-any
  createPortal: (node: any) => node,
}));

it('renders', () => {
  const service = new twirp.Service();
  expect(Renderer.create(
    <React.Fragment>
    <RegisterTargetModal service={service} onSuccess={_.noop} />
    </React.Fragment>,
  )).toMatchSnapshot();
});
