mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
13 lines
412 B
TypeScript
13 lines
412 B
TypeScript
|
import React, { forwardRef, ForwardRefRenderFunction } from 'react';
|
||
|
|
||
|
export const mockRenderWithProps = jest.fn();
|
||
|
|
||
|
export const MockComponentTestId = 'MockComponent';
|
||
|
|
||
|
const MockComponentWithRef: ForwardRefRenderFunction<any, any> = (props, ref) => {
|
||
|
mockRenderWithProps(props);
|
||
|
return <div ref={ref} data-testid={MockComponentTestId} />;
|
||
|
};
|
||
|
|
||
|
export const MockComponent = forwardRef(MockComponentWithRef);
|