use severity in test

This commit is contained in:
Max Grossman
2018-12-18 10:27:15 -05:00
parent 64f2d913e8
commit 6ba8bacb75
2 changed files with 5 additions and 5 deletions

View File

@@ -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;
}, {});

View File

@@ -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);
});
});
});