From 67d7ec1695d70ff2f5d129eed5da3c6c92831238 Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Sat, 6 Dec 2014 23:57:41 +0000 Subject: [PATCH] Fix travis --- spec/axis-spec.js | 2 +- spec/data-spec.js | 80 +++++++++++++++++++++++------------------------ 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/spec/axis-spec.js b/spec/axis-spec.js index dc6c010..d4a06b7 100644 --- a/spec/axis-spec.js +++ b/spec/axis-spec.js @@ -742,7 +742,7 @@ describe('c3 chart axis', function () { it('should not have inner y axis', function () { var paddingRight = chart.internal.getCurrentPaddingRight(), tickTexts = chart.internal.main.selectAll('.c3-axis-2y g.tick text'); - expect(paddingRight).toBe(40); + expect(paddingRight).toBeGreaterThan(39); tickTexts.each(function () { expect(+d3.select(this).attr('x')).toBeGreaterThan(0); }); diff --git a/spec/data-spec.js b/spec/data-spec.js index 4ae515a..9d03491 100644 --- a/spec/data-spec.js +++ b/spec/data-spec.js @@ -199,8 +199,8 @@ describe('c3 chart data', function () { expectedXs = [74, 221, 368, 515]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -221,8 +221,8 @@ describe('c3 chart data', function () { expectedXs = [6, 198, 391, 583]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -250,8 +250,8 @@ describe('c3 chart data', function () { expectedXs = [490, 516, 490, 4]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -272,8 +272,8 @@ describe('c3 chart data', function () { expectedXs = [76, 526, 76, 4]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -317,8 +317,8 @@ describe('c3 chart data', function () { expectedXs = [74, 221, 368, 515]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -339,8 +339,8 @@ describe('c3 chart data', function () { expectedXs = [6, 198, 391, 583]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -368,8 +368,8 @@ describe('c3 chart data', function () { expectedXs = [103, 78, 103, 526]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -390,8 +390,8 @@ describe('c3 chart data', function () { expectedXs = [511, 67, 511, 526]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -435,8 +435,8 @@ describe('c3 chart data', function () { expectedXs = [74, 221, 368, 515]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -457,8 +457,8 @@ describe('c3 chart data', function () { expectedXs = [6, 198, 391, 583]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); }); @@ -485,8 +485,8 @@ describe('c3 chart data', function () { expectedXs = [69, 525, 513, 295]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -507,8 +507,8 @@ describe('c3 chart data', function () { expectedXs = [67, 527, 515, 297]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); }); @@ -547,8 +547,8 @@ describe('c3 chart data', function () { expectedXs = [74, 221, 368, 515]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -569,8 +569,8 @@ describe('c3 chart data', function () { expectedXs = [6, 198, 391, 583]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -598,8 +598,8 @@ describe('c3 chart data', function () { expectedXs = [57, 150, 77, 363]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -620,8 +620,8 @@ describe('c3 chart data', function () { expectedXs = [107, 192, 125, 386]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); }); @@ -660,8 +660,8 @@ describe('c3 chart data', function () { expectedXs = [74, 221, 368, 515]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -682,8 +682,8 @@ describe('c3 chart data', function () { expectedXs = [6, 198, 391, 583]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -711,8 +711,8 @@ describe('c3 chart data', function () { expectedXs = [533, 440, 513, 230]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); @@ -733,8 +733,8 @@ describe('c3 chart data', function () { expectedXs = [480, 397, 462, 205]; texts.each(function (d, i) { var text = d3.select(this); - expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -1); - expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -1); + expect(+text.attr('y')).toBeCloseTo(expectedYs[i], -2); + expect(+text.attr('x')).toBeCloseTo(expectedXs[i], -2); }); }); });