"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_hooks_1 = require("@testing-library/react-hooks");
var react_1 = __importDefault(require("react"));
var index_1 = require("./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_1.default.createElement(index_1.ReloadDataProvider, null, children));
        };
        var result = (0, react_hooks_1.renderHook)(index_1.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);
    });
});
