diff --git a/modules/ui/commit_warnings.js b/modules/ui/commit_warnings.js index 2317fc9f5..8b517c9c3 100644 --- a/modules/ui/commit_warnings.js +++ b/modules/ui/commit_warnings.js @@ -15,11 +15,11 @@ export function uiCommitWarnings(context) { var validations = context.history().validate(changes); validations = _reduce(validations, function(validations, val) { - var type = val.id === 'mapcss_error' ? 'error' : 'warning'; - if (validations.hasOwnProperty(type)) { - validations[type].push(val); + var severity = val.severity; + if (validations.hasOwnProperty(severity)) { + validations[severity].push(val); } else { - validations[type] = [val]; + validations[severity] = [val]; } return validations; }, {}); diff --git a/test/spec/services/maprules.js b/test/spec/services/maprules.js index d4c535f40..cf17f7266 100644 --- a/test/spec/services/maprules.js +++ b/test/spec/services/maprules.js @@ -554,7 +554,7 @@ describe('maprules', function() { expect(warnings.length).to.eql(1); expect(warning.entity).to.eql(entity); expect(warning.message).to.eql(selector[type]); - expect('mapcss_' + type).to.eql(warning.id); + expect(type).to.eql(warning.severity); }); }); });