Skip to content

Commit a99c349

Browse files
committed
replace $.extend(true, , ) with clone in plotlyjs tests
1 parent d4894e2 commit a99c349

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

shelly/plotlyjs/static/plotlyjs/tests/axes_test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var Plotly = require('../src/plotly');
2+
var clone = require('clone');
23

34
describe('Test axes', function () {
45
'use strict';
@@ -27,7 +28,7 @@ describe('Test axes', function () {
2728
}
2829
}
2930
};
30-
var expectedYaxis = $.extend(true, {}, gd.layout.xaxis),
31+
var expectedYaxis = clone(gd.layout.xaxis),
3132
expectedXaxis = {
3233
title: 'Click to enter X axis title',
3334
type: 'date'
@@ -60,7 +61,7 @@ describe('Test axes', function () {
6061
}
6162
}
6263
};
63-
var expectedLayoutAfter = $.extend(true, {}, gd.layout);
64+
var expectedLayoutAfter = clone(gd.layout);
6465
expectedLayoutAfter.xaxis.type = 'linear';
6566
expectedLayoutAfter.yaxis.type = 'linear';
6667

shelly/plotlyjs/static/plotlyjs/tests/graph_obj_test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var Plotly = require('../src/plotly');
2+
var clone = require('clone');
23

34
describe('Test graph_obj', function () {
45
'use strict';
@@ -562,7 +563,7 @@ describe('Test graph_obj', function () {
562563
});
563564

564565
it('prepend is the inverse of extend - no maxPoints', function () {
565-
var cachedData = $.extend(true, [], gd.data);
566+
var cachedData = clone(gd.data);
566567

567568
Plotly.extendTraces(gd, {
568569
x: [[3, 4], [4, 5]], 'marker.size': [[0, -1], [5, 6]]
@@ -580,7 +581,7 @@ describe('Test graph_obj', function () {
580581

581582

582583
it('extend is the inverse of prepend - no maxPoints', function () {
583-
var cachedData = $.extend(true, [], gd.data);
584+
var cachedData = clone(gd.data);
584585

585586
Plotly.prependTraces(gd, {
586587
x: [[3, 4], [4, 5]], 'marker.size': [[0, -1], [5, 6]]
@@ -599,7 +600,7 @@ describe('Test graph_obj', function () {
599600

600601
it('prepend is the inverse of extend - with maxPoints', function () {
601602
var maxPoints = 3;
602-
var cachedData = $.extend(true, [], gd.data);
603+
var cachedData = clone(gd.data);
603604

604605
Plotly.extendTraces(gd, {
605606
x: [[3, 4], [4, 5]], 'marker.size': [[0, -1], [5, 6]]

0 commit comments

Comments
 (0)