Skip to content

Commit 4b97ca9

Browse files
committed
Update tests per library change
1 parent a1e2dee commit 4b97ca9

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

test/jasmine/tests/axes_test.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ var Plots = require('../../../src/plots/plots');
77
var Lib = require('../../../src/lib');
88
var Loggers = require('../../../src/lib/loggers');
99
var Color = require('../../../src/components/color');
10-
var tinycolor = require('tinycolor2');
1110

1211
var handleTickValueDefaults = require('../../../src/plots/cartesian/tick_value_defaults');
1312
var Cartesian = require('../../../src/plots/cartesian');
@@ -467,11 +466,11 @@ describe('Test axes', function() {
467466
yaxis: {}
468467
};
469468
supplyLayoutDefaults(layoutIn, layoutOut, fullData);
470-
var lightLine = tinycolor(Color.lightLine).toRgbString();
469+
var lightLine = Color.color(Color.lightLine).rgb().string();
471470
expect(layoutOut.xaxis.gridwidth).toBe(1);
472-
expect(tinycolor(layoutOut.xaxis.gridcolor).toRgbString()).toBe(lightLine);
471+
expect(Color.color(layoutOut.xaxis.gridcolor).rgb().string()).toBe(lightLine);
473472
expect(layoutOut.yaxis.gridwidth).toBe(1);
474-
expect(tinycolor(layoutOut.yaxis.gridcolor).toRgbString()).toBe(lightLine);
473+
expect(Color.color(layoutOut.yaxis.gridcolor).rgb().string()).toBe(lightLine);
475474
});
476475

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

568567
supplyLayoutDefaults(layoutIn, layoutOut, fullData);
569-
expect(layoutOut.xaxis.gridcolor)
570-
.toEqual(tinycolor.mix('red', bgColor, frac).toRgbString());
568+
expect(layoutOut.xaxis.gridcolor).toEqual(Color.mix('red', bgColor, frac));
571569
expect(layoutOut.yaxis.gridcolor).toEqual('blue');
572-
expect(layoutOut.yaxis2.gridcolor)
573-
.toEqual(tinycolor.mix('#444', bgColor, frac).toRgbString());
570+
expect(layoutOut.yaxis2.gridcolor).toEqual(Color.mix('#444', bgColor, frac));
574571
});
575572

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

585582
supplyLayoutDefaults(layoutIn, layoutOut, fullData);
586-
expect(layoutOut.xaxis.tickfont.color).toEqual('#444');
583+
expect(layoutOut.xaxis.tickfont.color).toEqual('rgb(68, 68, 68)');
587584
});
588585

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

598595
supplyLayoutDefaults(layoutIn, layoutOut, fullData);
599-
expect(layoutOut.xaxis.tickfont.color).toEqual('#fff');
596+
expect(layoutOut.xaxis.tickfont.color).toEqual('rgb(255, 255, 255)');
600597
});
601598

602599
it('should not coerce ticklabelposition on *multicategory* axes for now', function() {

test/jasmine/tests/color_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ describe('Test color:', function() {
155155
}
156156
};
157157

158-
Color.fill(mockElement, 'rgba(255,255,0,0.5');
158+
Color.fill(mockElement, 'rgba(255,255,0,0.5)');
159159
});
160160
});
161161

@@ -168,27 +168,27 @@ describe('Test color:', function() {
168168
}
169169
};
170170

171-
Color.stroke(mockElement, 'rgba(255,255,0,0.5');
171+
Color.stroke(mockElement, 'rgba(255,255,0,0.5)');
172172
});
173173
});
174174

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

179-
expect(out).toEqual('#bbbbbb');
179+
expect(out).toEqual('rgb(190, 190, 190)');
180180
});
181181

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

185-
expect(out).toEqual('#f57a03');
185+
expect(out).toEqual('rgb(252, 139, 28)');
186186
});
187187

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

191-
expect(out).toEqual('#449dd4');
191+
expect(out).toEqual('rgb(47, 144, 205)');
192192
});
193193
});
194194
});

test/jasmine/tests/gl3dlayout_test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
var Plotly = require('../../../lib/index');
22
var Gl3d = require('../../../src/plots/gl3d');
33

4-
var tinycolor = require('tinycolor2');
54
var Color = require('../../../src/components/color');
65

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

379378
supplyLayoutDefaults(layoutIn, layoutOut, fullData);
380379
expect(layoutOut.scene.xaxis.gridcolor)
381-
.toEqual(tinycolor.mix('red', bgColor, frac).toRgbString());
380+
.toEqual(Color.mix('red', bgColor, frac));
382381
expect(layoutOut.scene.yaxis.gridcolor).toEqual('blue');
383382
expect(layoutOut.scene.zaxis.gridcolor)
384-
.toEqual(tinycolor.mix('#444', bgColor, frac).toRgbString());
383+
.toEqual(Color.mix('#444', bgColor, frac));
385384
});
386385

387386
it('should disable converting numeric strings using axis.autotypenumbers', function() {

test/jasmine/tests/hover_label_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,10 +949,10 @@ describe('hover info', function() {
949949
fontColor: 'rgb(255, 255, 255)'
950950
}, {
951951
bgcolor: 'rgb(0, 200, 0)',
952-
bordercolor: 'rgb(255, 255, 255)',
952+
bordercolor: 'rgb(68, 68, 68)',
953953
fontSize: 13,
954954
fontFamily: 'Arial',
955-
fontColor: 'rgb(255, 255, 255)'
955+
fontColor: 'rgb(68, 68, 68)'
956956
}, {
957957
bgcolor: 'rgb(255, 127, 14)',
958958
bordercolor: 'rgb(68, 68, 68)',

0 commit comments

Comments
 (0)