mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 15:34:49 +02:00
Remove deprecate tags test
This commit is contained in:
@@ -91,7 +91,6 @@
|
||||
<script src='../js/id/actions/move_way.js'></script>
|
||||
<script src='../js/id/actions/noop.js'></script>
|
||||
<script src='../js/id/actions/reverse.js'></script>
|
||||
<script src='../js/id/actions/deprecate_tags.js'></script>
|
||||
<script src='../js/id/actions/split.js'></script>
|
||||
|
||||
<script src='../js/id/behavior.js'></script>
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
describe('iD.actions.DeprecateTags', function () {
|
||||
it('deprecates tags', function () {
|
||||
var entity = iD.Entity({ tags: { barrier: 'wire_fence' } }),
|
||||
graph = iD.actions.DeprecateTags(entity.id)(iD.Graph([entity])),
|
||||
undeprecated = {
|
||||
barrier: 'fence',
|
||||
fence_type: 'chain'
|
||||
};
|
||||
expect(graph.entity(entity.id).tags).to.eql(undeprecated);
|
||||
});
|
||||
|
||||
it('does not overwrite explicit tags', function () {
|
||||
var entity = iD.Entity({ tags: { barrier: 'wire_fence', fence_type: 'foo' } }),
|
||||
graph = iD.actions.DeprecateTags(entity.id)(iD.Graph([entity])),
|
||||
undeprecated = {
|
||||
barrier: 'fence',
|
||||
fence_type: 'foo'
|
||||
};
|
||||
expect(graph.entity(entity.id).tags).to.eql(undeprecated);
|
||||
});
|
||||
|
||||
it('leaves other tags alone', function () {
|
||||
var entity = iD.Entity({ tags: { highway: 'ford', name: 'Foo' } }),
|
||||
graph = iD.actions.DeprecateTags(entity.id)(iD.Graph([entity])),
|
||||
undeprecated = {
|
||||
ford: 'yes',
|
||||
name: 'Foo'
|
||||
};
|
||||
expect(graph.entity(entity.id).tags).to.eql(undeprecated);
|
||||
});
|
||||
|
||||
it('wipes out tags that should be entirely removed', function () {
|
||||
var entity = iD.Entity({ tags: { 'tiger:source': 'foo' } }),
|
||||
graph = iD.actions.DeprecateTags(entity.id)(iD.Graph([entity])),
|
||||
undeprecated = { };
|
||||
expect(graph.entity(entity.id).tags).to.eql(undeprecated);
|
||||
});
|
||||
|
||||
it('replaces keys', function () {
|
||||
var entity = iD.Entity({ tags: { power_rating: '1 billion volts' } }),
|
||||
graph = iD.actions.DeprecateTags(entity.id)(iD.Graph([entity])),
|
||||
undeprecated = {
|
||||
'generator:output': '1 billion volts'
|
||||
};
|
||||
expect(graph.entity(entity.id).tags).to.eql(undeprecated);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user