Skip to content

Commit 24d7c47

Browse files
committedFeb 27, 2017
improve test case description string
- see #1414 (comment)
1 parent 1a22beb commit 24d7c47

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed
 

‎test/jasmine/tests/scattermapbox_test.js

+19-21
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ describe('scattermapbox convert', function() {
259259
lat: [20, 20, '10', null, 10, 10, 20]
260260
};
261261

262-
it('for markers + circle bubbles traces, should', function() {
262+
it('should generate correct output for markers + circle bubbles traces', function() {
263263
var opts = _convert(Lib.extendFlat({}, base, {
264264
mode: 'markers',
265265
marker: {
@@ -276,12 +276,12 @@ describe('scattermapbox convert', function() {
276276
stops: [
277277
[0, 'rgb(220, 220, 220)'], [1, '#444'], [2, 'rgb(178, 10, 28)']
278278
]
279-
}, 'have correct circle-color stops');
279+
}, 'circle-color stops');
280280

281281
expect(opts.circle.paint['circle-radius']).toEqual({
282282
property: 'circle-radius',
283283
stops: [ [0, 5], [1, 10], [2, 0] ]
284-
}, 'have correct circle-radius stops');
284+
}, 'circle-radius stops');
285285

286286
var circleProps = opts.circle.geojson.features.map(function(f) {
287287
return f.properties;
@@ -294,10 +294,10 @@ describe('scattermapbox convert', function() {
294294
{ 'circle-color': 2, 'circle-radius': 2 },
295295
{ 'circle-color': 1, 'circle-radius': 2 },
296296
{ 'circle-color': 1, 'circle-radius': 2 }
297-
], 'have correct geojson feature properties');
297+
], 'geojson feature properties');
298298
});
299299

300-
it('fill + markers + lines traces, should', function() {
300+
it('should generate correct output for fill + markers + lines traces', function() {
301301
var opts = _convert(Lib.extendFlat({}, base, {
302302
mode: 'markers+lines',
303303
marker: { symbol: 'circle' },
@@ -312,19 +312,19 @@ describe('scattermapbox convert', function() {
312312
var lineCoords = [segment1, segment2],
313313
fillCoords = [[segment1], [segment2]];
314314

315-
expect(opts.line.geojson.coordinates).toEqual(lineCoords, 'have correct line coords');
316-
expect(opts.fill.geojson.coordinates).toEqual(fillCoords, 'have correct fill coords');
315+
expect(opts.line.geojson.coordinates).toEqual(lineCoords, 'line coords');
316+
expect(opts.fill.geojson.coordinates).toEqual(fillCoords, 'fill coords');
317317

318318
var circleCoords = opts.circle.geojson.features.map(function(f) {
319319
return f.geometry.coordinates;
320320
});
321321

322322
expect(circleCoords).toEqual([
323323
[10, 20], [20, 20], [30, 10], [20, 10], [10, 20]
324-
], 'have correct circle coords');
324+
], 'circle coords');
325325
});
326326

327-
it('for markers + non-circle traces, should', function() {
327+
it('should generate correct output for markers + non-circle traces', function() {
328328
var opts = _convert(Lib.extendFlat({}, base, {
329329
mode: 'markers',
330330
marker: { symbol: 'monument' }
@@ -340,10 +340,10 @@ describe('scattermapbox convert', function() {
340340
return ['monument', ''];
341341
});
342342

343-
expect(symbolProps).toEqual(expected, 'have correct geojson properties');
343+
expect(symbolProps).toEqual(expected, 'geojson properties');
344344
});
345345

346-
it('for text + lines traces, should', function() {
346+
it('should generate correct output for text + lines traces', function() {
347347
var opts = _convert(Lib.extendFlat({}, base, {
348348
mode: 'lines+text',
349349
connectgaps: true,
@@ -356,7 +356,7 @@ describe('scattermapbox convert', function() {
356356
[10, 20], [20, 20], [30, 10], [20, 10], [10, 20]
357357
];
358358

359-
expect(opts.line.geojson.coordinates).toEqual(lineCoords, 'have correct line coords');
359+
expect(opts.line.geojson.coordinates).toEqual(lineCoords, 'line coords');
360360

361361
var actualText = opts.symbol.geojson.features.map(function(f) {
362362
return f.properties.text;
@@ -365,7 +365,7 @@ describe('scattermapbox convert', function() {
365365
expect(actualText).toEqual(['A', 'B', 'C', 'F', '']);
366366
});
367367

368-
it('for lines traces with trailing gaps', function() {
368+
it('should generate correct output for lines traces with trailing gaps', function() {
369369
var opts = _convert(Lib.extendFlat({}, base, {
370370
mode: 'lines',
371371
lon: [10, '20', 30, 20, null, 20, 10, null, null],
@@ -412,15 +412,15 @@ describe('scattermapbox convert', function() {
412412
});
413413
});
414414

415-
it('for markers + circle bubbles traces with repeated values, should', function() {
415+
it('should generate correct output for markers + circle bubbles traces with repeated values', function() {
416416
var opts = _convert(Lib.extendFlat({}, base, {
417417
lon: ['-96.796988', '-81.379236', '-85.311819', ''],
418418
lat: ['32.776664', '28.538335', '35.047157', '' ],
419419
marker: { size: ['5', '49', '5', ''] }
420420
}));
421421

422422
expect(opts.circle.paint['circle-radius'].stops)
423-
.toBeCloseTo2DArray([[0, 2.5], [1, 24.5]], 'not replicate stops');
423+
.toBeCloseTo2DArray([[0, 2.5], [1, 24.5]], 'no replicate stops');
424424

425425
var radii = opts.circle.geojson.features.map(function(f) {
426426
return f.properties['circle-radius'];
@@ -429,7 +429,7 @@ describe('scattermapbox convert', function() {
429429
expect(radii).toBeCloseToArray([0, 1, 0], 'link features to correct stops');
430430
});
431431

432-
it('for input only blank pts', function() {
432+
it('should generate correct output for traces with only blank points', function() {
433433
var opts = _convert(Lib.extendFlat({}, base, {
434434
mode: 'lines',
435435
lon: ['', null],
@@ -439,18 +439,16 @@ describe('scattermapbox convert', function() {
439439

440440
assertVisibility(opts, ['none', 'none', 'none', 'none']);
441441

442-
expect(opts.line.geojson.coordinates).toEqual([], 'have correct line coords');
443-
expect(opts.fill.geojson.coordinates).toEqual([], 'have correct fill coords');
442+
expect(opts.line.geojson.coordinates).toEqual([], 'line coords');
443+
expect(opts.fill.geojson.coordinates).toEqual([], 'fill coords');
444444
});
445445

446446
function assertVisibility(opts, expectations) {
447447
var actual = ['fill', 'line', 'circle', 'symbol'].map(function(l) {
448448
return opts[l].layout.visibility;
449449
});
450450

451-
var msg = 'set layer visibility properly';
452-
453-
expect(actual).toEqual(expectations, msg);
451+
expect(actual).toEqual(expectations, 'layer visibility');
454452
}
455453
});
456454

0 commit comments

Comments
 (0)
Please sign in to comment.