Skip to content

Commit 59b741d

Browse files
committed
PR feedback: moved isValObject into coerce
1 parent 1ea2fd7 commit 59b741d

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

src/lib/coerce.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,3 +355,10 @@ exports.validate = function(value, opts) {
355355
valObject.coerceFunction(value, propMock, failed, opts);
356356
return out !== failed;
357357
};
358+
359+
/*
360+
* returns true for a valid value object and false for tree nodes in the attribute hierarchy
361+
*/
362+
exports.isValObject = function(obj) {
363+
return obj && obj.valType !== undefined;
364+
};

src/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ var lib = module.exports = {};
1515

1616
lib.nestedProperty = require('./nested_property');
1717
lib.isPlainObject = require('./is_plain_object');
18-
lib.isValObject = require('./is_val_object');
1918
lib.isArray = require('./is_array');
2019

2120
var coerceModule = require('./coerce');
@@ -24,6 +23,7 @@ lib.coerce = coerceModule.coerce;
2423
lib.coerce2 = coerceModule.coerce2;
2524
lib.coerceFont = coerceModule.coerceFont;
2625
lib.validate = coerceModule.validate;
26+
lib.isValObject = coerceModule.isValObject;
2727

2828
var datesModule = require('./dates');
2929
lib.dateTime2ms = datesModule.dateTime2ms;

src/lib/is_val_object.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

test/jasmine/tests/transform_groupby_test.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Plotly.register([
1010
require('@src/transforms/groupby')
1111
]);
1212

13-
describe('groupby', function() {
13+
fdescribe('groupby', function() {
1414

1515
describe('one-to-many transforms:', function() {
1616
'use strict';
@@ -350,7 +350,7 @@ describe('groupby', function() {
350350
describe('grouping with basic, heterogenous and overridden attributes', function() {
351351
'use strict';
352352

353-
//afterEach(destroyGraphDiv);
353+
afterEach(destroyGraphDiv);
354354

355355
function test(mockData) {
356356

@@ -511,8 +511,15 @@ describe('groupby', function() {
511511
it('passes with lots of attributes and heterogenous attrib presence', test(mockData2));
512512

513513
it('passes with group styles partially overriding top level aesthetics', test(mockData3));
514-
expect(gd._fullData[0].marker.line.color).toEqual(['orange', 'red', 'cyan', 'pink']);
515-
expect(gd._fullData[1].marker.line.color).toEqual('yellow');
514+
it('passes extended tests with group styles partially overriding top level aesthetics', function (done) {
515+
var data = Lib.extendDeep([], mockData3);
516+
var gd = createGraphDiv();
517+
Plotly.plot(gd, data).then(function() {
518+
expect(gd._fullData[0].marker.line.color).toEqual(['orange', 'red', 'cyan', 'pink']);
519+
expect(gd._fullData[1].marker.line.color).toEqual('yellow');
520+
done();
521+
});
522+
} );
516523

517524
it('passes with no explicit styling for the individual group', test(mockData4));
518525

0 commit comments

Comments
 (0)