Skip to content

Commit 62d6acf

Browse files
committed
improve splom restyle test
1 parent 8846ddb commit 62d6acf

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

test/jasmine/tests/splom_test.js

+19-4
Original file line numberDiff line numberDiff line change
@@ -995,19 +995,34 @@ describe('Test splom interactions:', function() {
995995
.then(function() {
996996
var fullData = gd._fullData;
997997
var fullLayout = gd._fullLayout;
998+
var splomScenes = fullLayout._splomScenes;
999+
var opts = splomScenes[fullData[1].uid].matrixOptions;
9981000

9991001
expect(fullData[0].visible).toBe(false, 'trace 0 visible');
10001002
expect(fullData[1].visible).toBe(true, 'trace 1 visible');
1001-
expect(Object.keys(fullLayout._splomScenes).length).toBe(1, '# of splom scenes');
1002-
expect(fullLayout._splomScenes[fullData[1].uid].matrixOptions.opacity).toBe(1, 'marker opacity');
1003+
expect(Object.keys(splomScenes).length).toBe(1, '# of splom scenes');
1004+
1005+
expect(opts.opacity).toBe(1, 'marker opacity');
1006+
expect(opts.color).toEqual(new Uint8Array([255, 127, 14, 255]), 'marker color');
1007+
expect(opts.colors).toBe(undefined, 'marker colors');
10031008

10041009
return Plotly.restyle(gd, 'marker.opacity', [undefined, [0.2, 0.3, 0.4]]);
10051010
})
10061011
.then(function() {
10071012
var fullData = gd._fullData;
10081013
var fullLayout = gd._fullLayout;
1009-
1010-
expect(fullLayout._splomScenes[fullData[1].uid].matrixOptions.opacity).toBe(1, 'marker opacity');
1014+
var opts = fullLayout._splomScenes[fullData[1].uid].matrixOptions;
1015+
1016+
// ignored by regl-splom
1017+
expect(opts.opacity).toBe(1, 'marker opacity');
1018+
// ignored by regl-splom
1019+
expect(opts.color).toEqual(new Uint8Array([255, 127, 14, 255]), 'marker color');
1020+
// marker.opacity applied here
1021+
expect(opts.colors).toBeCloseTo2DArray([
1022+
[1, 0.498, 0.0549, 0.2],
1023+
[1, 0.498, 0.0549, 0.3],
1024+
[1, 0.498, 0.0549, 0.4]
1025+
], 'marker colors');
10111026
})
10121027
.catch(failTest)
10131028
.then(done);

0 commit comments

Comments
 (0)