Skip to content

Commit

Permalink
use appropriate comparisons
Browse files Browse the repository at this point in the history
Fixes #1073. toBe, toEqual, toBeCloseTo... hopefully we're saying what
we really mean here
  • Loading branch information
gordonwoodhull committed Dec 22, 2015
1 parent 04e8f1e commit 03e06b1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions spec/base-mixin-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,11 @@ describe('dc.baseMixin', function () {
});

it('should set the height to the div size', function () {
expect(chart.height()).toEqual(220);
expect(chart.height()).toBeCloseTo(220,1);
});

it('should set the width to the div size', function () {
expect(chart.width()).toEqual(230);
expect(chart.width()).toBeCloseTo(230,1);
});

describe('and redrawn', function () {
Expand All @@ -387,8 +387,8 @@ describe('dc.baseMixin', function () {
});

it('should keep the size the same', function () {
expect(chart.height()).toBe(h0);
expect(chart.width()).toBe(w0);
expect(chart.height()).toEqual(h0,1);
expect(chart.width()).toEqual(w0);
});
});

Expand All @@ -399,11 +399,11 @@ describe('dc.baseMixin', function () {
});

it('should set the height to the minimum', function () {
expect(chart.height()).toEqual(234);
expect(chart.height()).toBeCloseTo(234,1);
});

it('should set the width to the minimum', function () {
expect(chart.width()).toEqual(976);
expect(chart.width()).toBeCloseTo(976,1);
});
});
});
Expand Down Expand Up @@ -433,8 +433,8 @@ describe('dc.baseMixin', function () {
});

it('should keep the size the same', function () {
expect(chart.height()).toBe(h0);
expect(chart.width()).toBe(w0);
expect(chart.height()).toEqual(h0);
expect(chart.width()).toEqual(w0);
});
});
});
Expand Down Expand Up @@ -466,6 +466,7 @@ describe('dc.baseMixin', function () {

it('should ask the callback for the width', function () {
expect(chart.width()).toEqual(800);
expect(setterSpy).toHaveBeenCalled();
});
});
});
Expand Down

0 comments on commit 03e06b1

Please sign in to comment.