f5747c66a5f589a88372571a74c2ae6e34b3a8c1
1 describe('tr.graphing.Radar', function () {
3 return d3
.select("body").append("svg");
6 it('sets the size', function () {
8 spyOn(svg
, 'attr').andReturn(svg
);
10 var radarGraph
= new tr
.graphing
.Radar(svg
, 500);
12 expect(svg
.attr
).toHaveBeenCalledWith('width', 500);
13 expect(svg
.attr
).toHaveBeenCalledWith('height', 500);
16 describe('lines', function () {
17 it('plots a vertical line in the center', function () {
19 spyOn(svg
, 'append').andReturn(svg
);
20 spyOn(svg
, 'attr').andReturn(svg
);
22 var radarGraph
= new tr
.graphing
.Radar(svg
, 500);
26 expect(svg
.append
).toHaveBeenCalledWith('line');
27 expect(svg
.attr
).toHaveBeenCalledWith('x1', 500 / 2);
28 expect(svg
.attr
).toHaveBeenCalledWith('y1', 0);
29 expect(svg
.attr
).toHaveBeenCalledWith('x2', 500 / 2);
30 expect(svg
.attr
).toHaveBeenCalledWith('y2', 500);
31 expect(svg
.attr
).toHaveBeenCalledWith('stroke-width', 5);