Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update tests per library change
  • Loading branch information
camdecoster committed Aug 21, 2025
commit 4b97ca93f57fe0d43b39d1842932693e422e4346
17 changes: 7 additions & 10 deletions test/jasmine/tests/axes_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ var Plots = require('../../../src/plots/plots');
var Lib = require('../../../src/lib');
var Loggers = require('../../../src/lib/loggers');
var Color = require('../../../src/components/color');
var tinycolor = require('tinycolor2');

var handleTickValueDefaults = require('../../../src/plots/cartesian/tick_value_defaults');
var Cartesian = require('../../../src/plots/cartesian');
Expand Down Expand Up @@ -467,11 +466,11 @@ describe('Test axes', function() {
yaxis: {}
};
supplyLayoutDefaults(layoutIn, layoutOut, fullData);
var lightLine = tinycolor(Color.lightLine).toRgbString();
var lightLine = Color.color(Color.lightLine).rgb().string();
expect(layoutOut.xaxis.gridwidth).toBe(1);
expect(tinycolor(layoutOut.xaxis.gridcolor).toRgbString()).toBe(lightLine);
expect(Color.color(layoutOut.xaxis.gridcolor).rgb().string()).toBe(lightLine);
expect(layoutOut.yaxis.gridwidth).toBe(1);
expect(tinycolor(layoutOut.yaxis.gridcolor).toRgbString()).toBe(lightLine);
expect(Color.color(layoutOut.yaxis.gridcolor).rgb().string()).toBe(lightLine);
});

it('should set gridcolor/gridwidth to undefined if showgrid is false', function() {
Expand Down Expand Up @@ -566,11 +565,9 @@ describe('Test axes', function() {
var frac = 100 * (0xe - 0x4) / (0xf - 0x4);

supplyLayoutDefaults(layoutIn, layoutOut, fullData);
expect(layoutOut.xaxis.gridcolor)
.toEqual(tinycolor.mix('red', bgColor, frac).toRgbString());
expect(layoutOut.xaxis.gridcolor).toEqual(Color.mix('red', bgColor, frac));
expect(layoutOut.yaxis.gridcolor).toEqual('blue');
expect(layoutOut.yaxis2.gridcolor)
.toEqual(tinycolor.mix('#444', bgColor, frac).toRgbString());
expect(layoutOut.yaxis2.gridcolor).toEqual(Color.mix('#444', bgColor, frac));
});

it('should default to a dark color for tickfont when plotting background is light', function() {
Expand All @@ -583,7 +580,7 @@ describe('Test axes', function() {
};

supplyLayoutDefaults(layoutIn, layoutOut, fullData);
expect(layoutOut.xaxis.tickfont.color).toEqual('#444');
expect(layoutOut.xaxis.tickfont.color).toEqual('rgb(68, 68, 68)');
});

it('should default to a light color for tickfont when plotting background is dark', function() {
Expand All @@ -596,7 +593,7 @@ describe('Test axes', function() {
};

supplyLayoutDefaults(layoutIn, layoutOut, fullData);
expect(layoutOut.xaxis.tickfont.color).toEqual('#fff');
expect(layoutOut.xaxis.tickfont.color).toEqual('rgb(255, 255, 255)');
});

it('should not coerce ticklabelposition on *multicategory* axes for now', function() {
Expand Down
10 changes: 5 additions & 5 deletions test/jasmine/tests/color_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ describe('Test color:', function() {
}
};

Color.fill(mockElement, 'rgba(255,255,0,0.5');
Color.fill(mockElement, 'rgba(255,255,0,0.5)');
});
});

Expand All @@ -168,27 +168,27 @@ describe('Test color:', function() {
}
};

Color.stroke(mockElement, 'rgba(255,255,0,0.5');
Color.stroke(mockElement, 'rgba(255,255,0,0.5)');
});
});

describe('contrast', function() {
it('should darken light colors', function() {
var out = Color.contrast('#eee', 10, 20);

expect(out).toEqual('#bbbbbb');
expect(out).toEqual('rgb(190, 190, 190)');
});

it('should darken light colors (2)', function() {
var out = Color.contrast('#fdae61', 10, 20);

expect(out).toEqual('#f57a03');
expect(out).toEqual('rgb(252, 139, 28)');
});

it('should lighten dark colors', function() {
var out = Color.contrast('#2b83ba', 10, 20);

expect(out).toEqual('#449dd4');
expect(out).toEqual('rgb(47, 144, 205)');
});
});
});
5 changes: 2 additions & 3 deletions test/jasmine/tests/gl3dlayout_test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var Plotly = require('../../../lib/index');
var Gl3d = require('../../../src/plots/gl3d');

var tinycolor = require('tinycolor2');
var Color = require('../../../src/components/color');

var createGraphDiv = require('../assets/create_graph_div');
Expand Down Expand Up @@ -378,10 +377,10 @@ describe('Test Gl3d layout defaults', function() {

supplyLayoutDefaults(layoutIn, layoutOut, fullData);
expect(layoutOut.scene.xaxis.gridcolor)
.toEqual(tinycolor.mix('red', bgColor, frac).toRgbString());
.toEqual(Color.mix('red', bgColor, frac));
expect(layoutOut.scene.yaxis.gridcolor).toEqual('blue');
expect(layoutOut.scene.zaxis.gridcolor)
.toEqual(tinycolor.mix('#444', bgColor, frac).toRgbString());
.toEqual(Color.mix('#444', bgColor, frac));
});

it('should disable converting numeric strings using axis.autotypenumbers', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/jasmine/tests/hover_label_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -949,10 +949,10 @@ describe('hover info', function() {
fontColor: 'rgb(255, 255, 255)'
}, {
bgcolor: 'rgb(0, 200, 0)',
bordercolor: 'rgb(255, 255, 255)',
bordercolor: 'rgb(68, 68, 68)',
fontSize: 13,
fontFamily: 'Arial',
fontColor: 'rgb(255, 255, 255)'
fontColor: 'rgb(68, 68, 68)'
}, {
bgcolor: 'rgb(255, 127, 14)',
bordercolor: 'rgb(68, 68, 68)',
Expand Down
Loading