Skip to content

Commit 07f318a

Browse files
committed
update surface defaults tests
1 parent 3042c13 commit 07f318a

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

test/jasmine/tests/surface_test.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
var Surface = require('@src/traces/surface');
22

3+
var Lib = require('@src/lib');
4+
35

46
describe('Test surface', function() {
57
'use strict';
@@ -37,13 +39,28 @@ describe('Test surface', function() {
3739
traceIn = {
3840
z: [[1,2,3], [2,1,2]],
3941
contours: {
40-
x: { show: true }
42+
x: {},
43+
y: { show: true },
44+
z: { show: false, highlight: false }
4145
}
4246
};
4347

48+
var fullOpts = {
49+
show: false,
50+
highlight: true,
51+
project: { x: false, y: false, z: false },
52+
highlightcolor: '#444',
53+
highlightwidth: 2
54+
};
55+
4456
supplyDefaults(traceIn, traceOut, defaultColor, layout);
45-
expect(traceOut.contours.x.project).toEqual({ x: false, y: false, z: false });
46-
expect(traceOut.contours.y).toEqual({ show: false, highlight: false });
57+
expect(traceOut.contours.x).toEqual(fullOpts);
58+
expect(traceOut.contours.y).toEqual(Lib.extendDeep({}, fullOpts, {
59+
show: true,
60+
color: '#444',
61+
width: 2,
62+
usecolormap: false
63+
}));
4764
expect(traceOut.contours.z).toEqual({ show: false, highlight: false });
4865
});
4966

@@ -56,7 +73,7 @@ describe('Test surface', function() {
5673
};
5774

5875
supplyDefaults(traceIn, traceOut, defaultColor, layout);
59-
expect(traceOut.contours.x.color).toEqual('#000');
76+
expect(traceOut.contours.x.color).toEqual('#444');
6077
expect(traceOut.contours.x.width).toEqual(2);
6178
expect(traceOut.contours.x.usecolormap).toEqual(false);
6279

0 commit comments

Comments
 (0)