"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("@testing-library/react");
require("@testing-library/jest-dom");
const ErrorMessage_1 = __importDefault(require("./ErrorMessage"));
test('Renders with title', () => {
    (0, react_1.render)((0, jsx_runtime_1.jsx)(ErrorMessage_1.default, { title: "Error occurred" }));
    expect(react_1.screen.getByText('Error occurred')).toBeVisible();
});
test('Renders with children', () => {
    (0, react_1.render)((0, jsx_runtime_1.jsx)(ErrorMessage_1.default, { title: "Error occurred", children: "This is the error message body" }));
    expect(react_1.screen.getByText('This is the error message body')).toBeVisible();
});
test('Renders with action links', () => {
    const actionLinks = ((0, jsx_runtime_1.jsx)("a", { href: "#retry", "data-testid": "retry-link", children: "Retry action link" }));
    (0, react_1.render)((0, jsx_runtime_1.jsx)(ErrorMessage_1.default, { title: "Error occurred", actionLinks: actionLinks }));
    expect(react_1.screen.getByText('Retry action link')).toBeVisible();
});
test('Renders with custom className', () => {
    (0, react_1.render)((0, jsx_runtime_1.jsx)(ErrorMessage_1.default, { title: "Error occurred", className: "custom-error-class" }));
    expect(react_1.screen.getByText('Error occurred').parentElement).toHaveClass('custom-error-class');
});
test('Renders with spread props', () => {
    (0, react_1.render)((0, jsx_runtime_1.jsx)(ErrorMessage_1.default, { title: "Error occurred", id: "test-error-id" }));
    expect(react_1.screen.getByText('Error occurred').parentElement).toHaveAttribute('id', 'test-error-id');
});
