import React from 'react';
import Graph from 'graphology';
import { render, screen } from '@testing-library/react';
import { DataModelGraph } from '../DataModelGraph';
import { useDataModelGraphAppearance } from './hooks/useDataModelGraphAppearance';
import { useCircleLayout } from '../hooks/useCircleLayout';
jest.mock('@react-sigma/core', function () { return ({
    SigmaContainer: function (_a) {
        var children = _a.children;
        return React.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.createElement("div", null, "ZoomSlider"); }
}); });
describe('DataModelGraph tests', function () {
    var graph = new Graph();
    var selectedNode = 'node1';
    var onNodeClick = jest.fn();
    var selectedEdges = ['edge1'];
    var onEdgeLabelClick = jest.fn();
    var setUp = function () {
        render(React.createElement(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).toHaveBeenCalledWith(expect.objectContaining({
            graph: graph,
            selectedNode: selectedNode,
            selectedEdges: selectedEdges,
            onNodeClick: onNodeClick,
            onEdgeLabelClick: onEdgeLabelClick
        }));
        expect(useCircleLayout).toHaveBeenCalledWith(expect.objectContaining({ graph: graph, animationDuration: 3000 }));
        expect(screen.getByText('ZoomSlider')).toBeInTheDocument();
    });
});
