Skip to content

Commit bca36a7

Browse files
committed
use 'official' Plotly in test suite,
instead of internal Plotly
1 parent 293186b commit bca36a7

13 files changed

+100
-95
lines changed

test/jasmine/tests/choropleth_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
var Plotly = require('@src/plotly');
21
var Choropleth = require('@src/traces/choropleth');
2+
var Plots = require('@src/plots/plots');
33

44

55
describe('Test choropleth', function() {
@@ -11,7 +11,7 @@ describe('Test choropleth', function() {
1111

1212
var defaultColor = '#444',
1313
layout = {
14-
font: Plotly.Plots.layoutAttributes.font
14+
font: Plots.layoutAttributes.font
1515
};
1616

1717
beforeEach(function() {

test/jasmine/tests/color_test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var Plotly = require('@src/plotly');
1+
var Color = require('@src/components/color');
22

33

44
describe('Test color:', function() {
@@ -15,7 +15,7 @@ describe('Test color:', function() {
1515
rgbacolor: 'rgba(51, 102, 153, 0.8)'
1616
};
1717

18-
Plotly.Color.clean(container);
18+
Color.clean(container);
1919
expect(container).toEqual(expectedContainer);
2020
});
2121

@@ -51,7 +51,7 @@ describe('Test color:', function() {
5151
]
5252
};
5353

54-
Plotly.Color.clean(container);
54+
Color.clean(container);
5555
expect(container).toEqual(expectedContainer);
5656
});
5757

@@ -70,7 +70,7 @@ describe('Test color:', function() {
7070
fractionrgbacolor: 'rgba(0, 102, 204, 1)'
7171
};
7272

73-
Plotly.Color.clean(container);
73+
Color.clean(container);
7474
expect(container).toEqual(expectedContainer);
7575
});
7676

@@ -86,7 +86,7 @@ describe('Test color:', function() {
8686
rgbacolor: 'rgba(51, 102, 153, 0.8)'
8787
};
8888

89-
Plotly.Color.clean(container);
89+
Color.clean(container);
9090
expect(container).toEqual(expectedContainer);
9191
});
9292

@@ -102,7 +102,7 @@ describe('Test color:', function() {
102102
rgba2color: 'rgba(26, 51, 128, 1)'
103103
};
104104

105-
Plotly.Color.clean(container);
105+
Color.clean(container);
106106
expect(container).toEqual(expectedContainer);
107107
});
108108

@@ -117,15 +117,15 @@ describe('Test color:', function() {
117117
var expectedContainer = {};
118118
Object.keys(container).forEach(function(k) { expectedContainer[k] = container[k]; });
119119

120-
Plotly.Color.clean(container);
120+
Color.clean(container);
121121
expect(container).toEqual(expectedContainer);
122122
});
123123

124124
it('should not barf on nulls', function() {
125125
var container1 = null;
126126
var expectedContainer1 = null;
127127

128-
Plotly.Color.clean(container1);
128+
Color.clean(container1);
129129
expect(container1).toEqual(expectedContainer1);
130130

131131
var container2 = {
@@ -141,7 +141,7 @@ describe('Test color:', function() {
141141
anarray: [null, {color: 'rgb(0.1, 0.1, 0.1)'}]
142142
};
143143

144-
Plotly.Color.clean(container2);
144+
Color.clean(container2);
145145
expect(container2).toEqual(expectedContainer2);
146146
});
147147
});

test/jasmine/tests/colorscale_test.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
var Plotly = require('@src/plotly');
21
var Colorscale = require('@src/components/colorscale');
2+
var Lib = require('@src/lib');
3+
var Plots = require('@src/plots/plots');
34
var Heatmap = require('@src/traces/heatmap');
45
var Scatter = require('@src/traces/scatter');
56

@@ -187,13 +188,13 @@ describe('Test colorscale:', function() {
187188
describe('handleDefaults (heatmap-like version)', function() {
188189
var handleDefaults = Colorscale.handleDefaults,
189190
layout = {
190-
font: Plotly.Plots.layoutAttributes.font
191+
font: Plots.layoutAttributes.font
191192
},
192193
opts = {prefix: '', cLetter: 'z'};
193194
var traceIn, traceOut;
194195

195196
function coerce(attr, dflt) {
196-
return Plotly.Lib.coerce(traceIn, traceOut, Heatmap.attributes, attr, dflt);
197+
return Lib.coerce(traceIn, traceOut, Heatmap.attributes, attr, dflt);
197198
}
198199

199200
beforeEach(function() {
@@ -257,13 +258,13 @@ describe('Test colorscale:', function() {
257258
describe('handleDefaults (scatter-like version)', function() {
258259
var handleDefaults = Colorscale.handleDefaults,
259260
layout = {
260-
font: Plotly.Plots.layoutAttributes.font
261+
font: Plots.layoutAttributes.font
261262
},
262263
opts = {prefix: 'marker.', cLetter: 'c'};
263264
var traceIn, traceOut;
264265

265266
function coerce(attr, dflt) {
266-
return Plotly.Lib.coerce(traceIn, traceOut, Scatter.attributes, attr, dflt);
267+
return Lib.coerce(traceIn, traceOut, Scatter.attributes, attr, dflt);
267268
}
268269

269270
beforeEach(function() {

test/jasmine/tests/config_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var Plotly = require('@src/plotly');
1+
var Plotly = require('@lib/index');
22
var createGraphDiv = require('../assets/create_graph_div');
33
var destroyGraphDiv = require('../assets/destroy_graph_div');
44

test/jasmine/tests/is_plain_object_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
var Plotly = require('@src/plotly');
1+
var Lib = require('@src/lib');
22

33
describe('isPlainObject', function() {
44
'use strict';
55

6-
var isPlainObject = Plotly.Lib.isPlainObject;
6+
var isPlainObject = Lib.isPlainObject;
77

88
function A() {}
99

test/jasmine/tests/legend_test.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
var Plotly = require('@src/plotly');
1+
var Legend = require('@src/components/legend');
2+
var Plots = require('@src/plots/plots');
23

34
describe('Test legend:', function() {
45
'use strict';
56

67
describe('supplyLayoutDefaults', function() {
7-
var supplyLayoutDefaults = Plotly.Legend.supplyLayoutDefaults;
8+
var supplyLayoutDefaults = Legend.supplyLayoutDefaults;
89

910
var layoutIn, layoutOut, fullData;
1011

@@ -13,8 +14,8 @@ describe('Test legend:', function() {
1314
showlegend: true
1415
};
1516
layoutOut = {
16-
font: Plotly.Plots.layoutAttributes.font,
17-
bg_color: Plotly.Plots.layoutAttributes.bg_color
17+
font: Plots.layoutAttributes.font,
18+
bg_color: Plots.layoutAttributes.bg_color
1819
};
1920
});
2021

@@ -62,7 +63,7 @@ describe('Test legend:', function() {
6263
});
6364

6465
describe('getLegendData', function() {
65-
var getLegendData = Plotly.Legend.getLegendData;
66+
var getLegendData = Legend.getLegendData;
6667

6768
var calcdata, opts, legendData, expected;
6869

0 commit comments

Comments
 (0)