Skip to content

Commit 4bc3d35

Browse files
author
Jon M. Mease
committed
Fix plotschema tests in the presence of potentially undefined schema attributes
1 parent e8ded39 commit 4bc3d35

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/jasmine/bundle_tests/plotschema_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ describe('plot schema', function() {
153153
// check that no other object has '_isSubplotObj'
154154
assertPlotSchema(
155155
function(attr, attrName) {
156-
if(attr[IS_SUBPLOT_OBJ] === true) {
156+
if(attr && attr[IS_SUBPLOT_OBJ] === true) {
157157
expect(astrs.indexOf(attrName)).not.toEqual(-1);
158158
cnt++;
159159
}
@@ -228,7 +228,7 @@ describe('plot schema', function() {
228228

229229
assertPlotSchema(
230230
function(attr, attrName, attrs, level, attrString) {
231-
if(isPlainObject(attr[DEPRECATED])) {
231+
if(attr && isPlainObject(attr[DEPRECATED])) {
232232
Object.keys(attr[DEPRECATED]).forEach(function(dAttrName) {
233233
var dAttr = attr[DEPRECATED][dAttrName];
234234

@@ -244,7 +244,7 @@ describe('plot schema', function() {
244244

245245
it('has valid or no `impliedEdits` in every attribute', function() {
246246
assertPlotSchema(function(attr, attrName, attrs, level, attrString) {
247-
if(attr.impliedEdits !== undefined) {
247+
if(attr && attr.impliedEdits !== undefined) {
248248
expect(isPlainObject(attr.impliedEdits))
249249
.toBe(true, attrString + ': ' + JSON.stringify(attr.impliedEdits));
250250
// make sure it wasn't emptied out

0 commit comments

Comments
 (0)