import React, { act } from 'react'; import { render, waitFor, screen, fireEvent } from '@testing-library/react'; import { Error } from '@squiz/resource-browser-ui-lib'; import { InlineLoadingErrorState } from './InlineLoadingErrorState'; jest.mock('@squiz/resource-browser-ui-lib', () => { return { ...jest.requireActual('@squiz/resource-browser-ui-lib'), Error: jest.fn(() =>
), }; }); describe('InlineLoadingErrorState', () => { const defaultProps = { isLoading: false, error: undefined, }; it('clicking close button should call the onClose callback', async () => { const onClose = jest.fn(); //@ts-ignore render(