import * as __WEBPACK_EXTERNAL_MODULE__testing_library_react__ from "@testing-library/react";
import * as __WEBPACK_EXTERNAL_MODULE__useConfirmModal_mjs__ from "./useConfirmModal.mjs";
describe('useConfirmModal', ()=>{
    test('should return API functions from hook', async ()=>{
        const { result } = (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.renderHook)(__WEBPACK_EXTERNAL_MODULE__useConfirmModal_mjs__["default"], {
            initialProps: {
                heading: 'Test modal heading',
                render: ()=>null
            }
        });
        expect(typeof result.current.renderModal).toBe('function');
        expect(typeof result.current.showModal).toBe('function');
    });
    test('should render a modal with heading and custom modal body', async ()=>{
        const { result } = (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.renderHook)(__WEBPACK_EXTERNAL_MODULE__useConfirmModal_mjs__["default"], {
            initialProps: {
                heading: 'Test modal heading',
                render: ()=>/*#__PURE__*/ React.createElement("div", null, "Modal content goes here")
            }
        });
        // toggle modal visibility
        await (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.waitFor)(()=>{
            result.current.showModal();
        });
        (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.render)(result.current.renderModal());
        const modalHeading = __WEBPACK_EXTERNAL_MODULE__testing_library_react__.screen.getByText(/Test modal heading/i);
        const modalContent = __WEBPACK_EXTERNAL_MODULE__testing_library_react__.screen.getByText(/Modal content goes here/i);
        expect(modalHeading).toBeInTheDocument();
        expect(modalContent).toBeInTheDocument();
    });
});
