insomnia/packages/insomnia-app/app/__jest__/mock-component.tsx
Dimitri Mitropoulos fd9fcf5031
fix: show JSON preview if content type is text/plain but body is valid json (#4171)
Co-authored-by: Opender Singh <opender.singh@konghq.com>
2021-11-08 16:39:26 -05:00

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);