mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
use severity in test
This commit is contained in:
@@ -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;
|
||||
}, {});
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user