From 7b99e71051b3592abe3c9d1b394abe9dcb376a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Wed, 3 Aug 2016 14:53:44 -0400 Subject: [PATCH] test: add heatmap calc case for category axes --- test/jasmine/tests/heatmap_test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/jasmine/tests/heatmap_test.js b/test/jasmine/tests/heatmap_test.js index c9a72894da9..1889016a1a6 100644 --- a/test/jasmine/tests/heatmap_test.js +++ b/test/jasmine/tests/heatmap_test.js @@ -302,6 +302,18 @@ describe('heatmap calc', function() { expect(out.y).toBeCloseToArray([-0.5, 0.5, 1.5]); expect(out.z).toBeCloseTo2DArray([[1, 2, 3], [3, 1, 2]]); }); + + it('should handle the category case', function() { + var out = _calc({ + x: ['a', 'b', 'c'], + y: ['z'], + z: [[17, 18, 19]] + }); + + expect(out.x).toBeCloseToArray([-0.5, 0.5, 1.5, 2.5]); + expect(out.y).toBeCloseToArray([-0.5, 0.5]); + expect(out.z).toBeCloseTo2DArray([[17, 18, 19]]); + }); }); describe('heatmap plot', function() {