import React from 'react';
import { render, screen } from '@testing-library/react';
import { ErrorWrapper } from './ErrorWrapper';
describe('Error wrapper tests', function () {
    it('should render children and error message', function () {
        render(React.createElement(ErrorWrapper, { errorMessage: "Some error message" },
            React.createElement("div", null, "Some content")));
        screen.getByText('Some content');
        screen.getByText('Some error message');
    });
    it('should render children without error message', function () {
        render(React.createElement(ErrorWrapper, null,
            React.createElement("div", null, "Some content")));
        screen.getByText('Some content');
        expect(screen.queryByTestId('error-message')).not.toBeInTheDocument();
    });
});
