make collection.index function to handle failing tests

This commit is contained in:
Max Grossman
2018-12-17 17:16:10 -05:00
parent d8de9e785e
commit 8f33a85a12
6 changed files with 18 additions and 6 deletions
+9
View File
@@ -84,6 +84,15 @@ describe('iD.presetCollection', function() {
});
});
describe('#index', function() {
it('returns preset position in the collection', function() {
expect(c.index('point')).to.equal(0);
});
it('return -1 when given id for preset not in the collection', function() {
expect(c.index('foobar')).to.equal(-1);
});
});
describe('#matchGeometry', function() {
it('returns a new collection only containing presets matching a geometry', function() {
expect(c.matchGeometry('area').collection).to.include.members(
+1 -1
View File
@@ -300,7 +300,7 @@ describe('maprules', function() {
});
});
describe('rule', function() {
var selectors, entities;
var selectors;
before(function() {
selectors = [
{