import { renderHook } from '@testing-library/react';
import React from 'react';
import { useReloadData, ReloadDataProvider } from './index';
describe('ReloadDataContext tests', function () {
    it('should add reload handlers, remove reload handlers and reload data correctly', function () {
        var Providers = function (_a) {
            var children = _a.children;
            return (React.createElement(ReloadDataProvider, null, children));
        };
        var result = renderHook(useReloadData, { wrapper: Providers }).result;
        var handler = jest.fn();
        result.current.addReloadHandler(handler);
        result.current.reloadData();
        expect(handler).toHaveBeenCalledTimes(1);
        result.current.removeReloadHandler(handler);
        result.current.reloadData();
        expect(handler).toHaveBeenCalledTimes(1);
    });
});
