mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-18 14:45:12 +02:00
Test friendlyName
This commit is contained in:
+8
-2
@@ -1,7 +1,7 @@
|
||||
describe('Util', function() {
|
||||
var util;
|
||||
|
||||
it('gives unique ids', function() {
|
||||
it('#id', function() {
|
||||
var a = iD.Util.id(),
|
||||
b = iD.Util.id(),
|
||||
c = iD.Util.id(),
|
||||
@@ -11,8 +11,14 @@ describe('Util', function() {
|
||||
expect(c === d).toEqual(false);
|
||||
});
|
||||
|
||||
it('creates a truthy object', function() {
|
||||
it('#trueObj', function() {
|
||||
expect(iD.Util.trueObj(['a', 'b', 'c'])).toEqual({ a: true, b: true, c: true });
|
||||
expect(iD.Util.trueObj([])).toEqual({});
|
||||
});
|
||||
|
||||
it('#friendlyName', function() {
|
||||
expect(iD.Util.friendlyName({ tags: { name: 'hi' }})).toEqual('hi');
|
||||
expect(iD.Util.friendlyName({ tags: { highway: 'Route 5' }})).toEqual('Route 5');
|
||||
expect(iD.Util.friendlyName({ tags: { name: 'hi', highway: 'Route 5' }})).toEqual('hi');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user