X-Git-Url: https://pwan.org/git/?p=tech-radar.git;a=blobdiff_plain;f=test%2Fgraphing%2Fradar-spec.js;h=76089888052f9fccb5080272512c5908edc31835;hp=f5747c66a5f589a88372571a74c2ae6e34b3a8c1;hb=d38f0a110aedcad816a2c74397d4eb65edb4da30;hpb=d2ec62108a5a5d9980f27a52466e5db7b83e4f6e diff --git a/test/graphing/radar-spec.js b/test/graphing/radar-spec.js index f5747c6..7608988 100644 --- a/test/graphing/radar-spec.js +++ b/test/graphing/radar-spec.js @@ -30,5 +30,22 @@ describe('tr.graphing.Radar', function () { expect(svg.attr).toHaveBeenCalledWith('y2', 500); expect(svg.attr).toHaveBeenCalledWith('stroke-width', 5); }); + + it('plots a horizontal line in the center', function () { + var svg = buildSvg(); + spyOn(svg, 'append').andReturn(svg); + spyOn(svg, 'attr').andReturn(svg); + + var radarGraph = new tr.graphing.Radar(svg, 500); + + radarGraph.plot(); + + expect(svg.append).toHaveBeenCalledWith('line'); + expect(svg.attr).toHaveBeenCalledWith('x1', 0); + expect(svg.attr).toHaveBeenCalledWith('y1', 500 / 2); + expect(svg.attr).toHaveBeenCalledWith('x2', 500); + expect(svg.attr).toHaveBeenCalledWith('y2', 500 / 2); + expect(svg.attr).toHaveBeenCalledWith('stroke-width', 5); + }); }) });