mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 23:44:47 +02:00
Moved area-keys to data, and process it during runtime
This commit is contained in:
committed by
John Firebaugh
parent
90b0f1c5bf
commit
dffeedffc9
@@ -190,7 +190,6 @@
|
||||
<script src='../js/id/core/relation.js'></script>
|
||||
<script src='../js/id/core/way.js'></script>
|
||||
<script src='../js/id/core/tree.js'></script>
|
||||
<script src='../js/id/core/area_keys.js'></script>
|
||||
<script src='../js/id/core/oneway_tags.js'></script>
|
||||
|
||||
<script src='../js/id/presets.js'></script>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
describe("iD.actions.Split", function () {
|
||||
|
||||
beforeEach(function () {
|
||||
iD.areaKeys = iD().presets(iD.data.presets).presets().areaKeys();
|
||||
});
|
||||
|
||||
describe("#disabled", function () {
|
||||
it("returns falsy for a non-end node of a single way", function () {
|
||||
var graph = iD.Graph([
|
||||
|
||||
@@ -40,6 +40,33 @@ describe("iD.presets", function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe("#areaKeys", function() {
|
||||
var presets = iD.presets().load({
|
||||
presets: {
|
||||
a: {
|
||||
tags: {
|
||||
a: '*'
|
||||
},
|
||||
geometry: ['point', 'line', 'area']
|
||||
},
|
||||
ab: {
|
||||
tags: {
|
||||
a: 'b'
|
||||
},
|
||||
geometry: ['line']
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it("whitelists keys from presets with area geometry", function() {
|
||||
expect(presets.areaKeys()).to.have.key('a');
|
||||
});
|
||||
|
||||
it("blacklists key-values from presets without an area geometry", function() {
|
||||
expect(presets.areaKeys().a.b).to.eq(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("expected matches", function() {
|
||||
var presets;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user