{"size": 1396, "ext": "js", "max_stars_repo_path": "test/Unit/Renderer/HightlightNodeRendererTest.js", "max_stars_repo_name": "marcbreitung/problem-graph-visualisation", "max_stars_repo_stars_event_min_datetime": "2018-01-10T20:28:37.000Z", "max_stars_repo_stars_event_max_datetime": "2018-01-10T20:28:37.000Z", "max_issues_repo_path": "test/Unit/Renderer/HightlightNodeRendererTest.js", "max_issues_repo_name": "marcbreitung/problem-graph-visualisation", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/Unit/Renderer/HightlightNodeRendererTest.js", "max_forks_repo_name": "marcbreitung/problem-graph-visualisation", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.2380952381, "max_line_length": 84, "alphanum_fraction": 0.5100286533}
let assert = require('chai').assert;
let sinon = require('sinon');
let jsdom = require('jsdom');

let {JSDOM} = jsdom;

import {HighlightNodeRenderer} from "../../../lib/Renderer/HighlightNodeRenderer";
import {Layer} from "../../../lib/Layer/Layer";

suite('HighlightNodeRenderer', function () {

    suite('#renderLevel(context, level)', function () {
        test('should call drawCircle', function () {
            let dom = (new JSDOM(`<body><canvas id="search-map"></canvas></body>`));
            let searchMap = dom.window.document.getElementById('search-map');
            let context = searchMap.getContext('2d');

            let layer = new Layer('layer', {
                'nodes': [{
                    'position': {'x': 10, 'y': 10},
                    'childs': [{'position': {'x': 40, 'y': 40}}]
                }, {
                    'label': '',
                    'position': {'x': 10, 'y': 10},
                    'childs': [{'position': {'x': 40, 'y': 40}}]
                }],
                'nodeColor': '#e34f00',
                'lineColor': '#385171'
            });

            let highlightNodeRenderer = new HighlightNodeRenderer();

            let spyDrawCircle = sinon.spy(highlightNodeRenderer, 'drawCircle');

            highlightNodeRenderer.renderLayer(context, layer);

            assert.isTrue(spyDrawCircle.calledTwice);
        });

    });

});