mirror of
https://github.com/Kong/insomnia
synced 2024-11-12 17:26:32 +00:00
fd9fcf5031
Co-authored-by: Opender Singh <opender.singh@konghq.com>
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);
|