"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var graphology_1 = __importDefault(require("graphology"));
var react_2 = require("@testing-library/react");
var DataModelGraph_1 = require("../DataModelGraph");
var useDataModelGraphAppearance_1 = require("./hooks/useDataModelGraphAppearance");
var useCircleLayout_1 = require("../hooks/useCircleLayout");
jest.mock('@react-sigma/core', function () { return ({
    SigmaContainer: function (_a) {
        var children = _a.children;
        return react_1.default.createElement("div", null, children);
    },
    useSigma: jest.fn().mockReturnValue({
        refresh: jest.fn()
    }),
    useLoadGraph: jest.fn().mockReturnValue(jest.fn())
}); });
jest.mock('../hooks/useCircleLayout', function () { return ({
    useCircleLayout: jest.fn()
}); });
jest.mock('../hooks/useSigmaCustomRenderers', function () { return ({
    useSigmaCustomRenderers: jest.fn().mockReturnValue({ addRenderers: jest.fn() })
}); });
jest.mock('./hooks/useDataModelGraphAppearance', function () { return ({
    useDataModelGraphAppearance: jest.fn()
}); });
jest.mock('../ZoomSlider', function () { return ({
    ZoomSlider: function () { return react_1.default.createElement("div", null, "ZoomSlider"); }
}); });
describe('DataModelGraph tests', function () {
    var graph = new graphology_1.default();
    var selectedNode = 'node1';
    var onNodeClick = jest.fn();
    var selectedEdges = ['edge1'];
    var onEdgeLabelClick = jest.fn();
    var setUp = function () {
        (0, react_2.render)(react_1.default.createElement(DataModelGraph_1.DataModelGraph, { graph: graph, selectedNode: selectedNode, onNodeClick: onNodeClick, selectedEdges: selectedEdges, onEdgeLabelClick: onEdgeLabelClick, hideInteractionTypes: false }));
    };
    afterEach(function () {
        jest.clearAllMocks();
    });
    it('renders call hooks with correct props', function () {
        setUp();
        expect(useDataModelGraphAppearance_1.useDataModelGraphAppearance).toHaveBeenCalledWith(expect.objectContaining({
            graph: graph,
            selectedNode: selectedNode,
            selectedEdges: selectedEdges,
            onNodeClick: onNodeClick,
            onEdgeLabelClick: onEdgeLabelClick
        }));
        expect(useCircleLayout_1.useCircleLayout).toHaveBeenCalledWith(expect.objectContaining({ graph: graph, animationDuration: 3000 }));
        expect(react_2.screen.getByText('ZoomSlider')).toBeInTheDocument();
    });
});
