From 629f13e5e8a7ed2e610db03b5b048b590e195477 Mon Sep 17 00:00:00 2001 From: mbr Date: Mon, 7 Dec 2015 23:08:03 +0100 Subject: [PATCH] fix unit tests calls --- spec/legend-spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/legend-spec.js b/spec/legend-spec.js index ab81dd7..51a142b 100644 --- a/spec/legend-spec.js +++ b/spec/legend-spec.js @@ -297,7 +297,7 @@ describe('c3 chart legend', function () { it('renders the correct distance between right legend elements', function () { var expectedWidth = 55, expectedHeight = 33; - d3.selectAll('.c3-legend-item-event').each(function (d, i) { + d3.selectAll('.c3-legend-item-event').each(function () { var rect = d3.select(this).node().getBoundingClientRect(); expect(rect.width).toBeCloseTo(expectedWidth, -2); expect(rect.height).toBeCloseTo(expectedHeight, -2); @@ -327,6 +327,7 @@ describe('c3 chart legend', function () { var expectedWidth = 55, expectedHeight = 18; d3.selectAll('.c3-legend-item-event').each(function (d, i) { + expect(d).toBeDefined(); var rect = d3.select(this).node().getBoundingClientRect(); expect(rect.width).toBeCloseTo(expectedWidth + ((i === 2) ? 15 : 0), -2); expect(rect.height).toBeCloseTo(expectedHeight, -2);