mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
fixing tests around issues
This commit is contained in:
@@ -3,6 +3,12 @@ import _intersection from 'lodash-es/intersection';
|
||||
import _reduce from 'lodash-es/reduce';
|
||||
import _every from 'lodash-es/every';
|
||||
|
||||
import {
|
||||
ValidationIssueType,
|
||||
ValidationIssueSeverity,
|
||||
validationIssue
|
||||
} from '../validations/validation_issue';
|
||||
|
||||
var buildRuleChecks = function() {
|
||||
return {
|
||||
equals: function (equals) {
|
||||
|
||||
@@ -546,18 +546,18 @@ describe('maprules', function() {
|
||||
selectors.forEach(function(selector) { iD.serviceMapRules.addRule(selector); });
|
||||
validationRules = iD.serviceMapRules.validationRules();
|
||||
});
|
||||
it('finds warnings', function() {
|
||||
it('finds issues', function() {
|
||||
validationRules.forEach(function(rule, i) {
|
||||
var warnings = [];
|
||||
var issues = [];
|
||||
var entity = entities[i];
|
||||
var selector = selectors[i];
|
||||
|
||||
rule.findWarnings(entity, _graph, warnings);
|
||||
rule.findIssues(entity, _graph, issues);
|
||||
|
||||
var warning = warnings[0];
|
||||
var warning = issues[0];
|
||||
var type = Object.keys(selector).indexOf('error') ? 'error' : 'warning';
|
||||
|
||||
expect(warnings.length).to.eql(1);
|
||||
expect(issues.length).to.eql(1);
|
||||
expect(warning.entity).to.eql(entity);
|
||||
expect(warning.message).to.eql(selector[type]);
|
||||
expect(type).to.eql(warning.severity);
|
||||
@@ -566,4 +566,3 @@ describe('maprules', function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user