Browse Source

Add much needed whitespace

pull/407/head
Julian Simioni 9 years ago
parent
commit
fa07ba9ddc
  1. 10
      test/unit/sanitiser/_layers.js

10
test/unit/sanitiser/_layers.js

@ -10,6 +10,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
t.equal(messages.errors.length, 0, 'no errors');
t.end();
});
test('invalid layer', function(t) {
var raw = { layers: 'test_layer' };
var clean = {};
@ -22,6 +23,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
t.true(messages.errors[0].length > msg.length, 'invalid error message');
t.end();
});
test('venue (alias) layer', function(t) {
var venue_layers = ['geoname','osmnode','osmway'];
var raw = { layers: 'venue' };
@ -32,6 +34,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
t.deepEqual(clean.types.from_layers, venue_layers, 'venue layers set');
t.end();
});
test('coarse (alias) layer', function(t) {
var admin_layers = ['admin0','admin1','admin2','neighborhood','locality','local_admin'];
var raw = { layers: 'coarse' };
@ -42,6 +45,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
t.deepEqual(clean.types.from_layers, admin_layers, 'coarse layers set');
t.end();
});
test('address (alias) layer', function(t) {
var address_layers = ['osmaddress','openaddresses'];
var raw = { layers: 'address' };
@ -52,6 +56,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
t.deepEqual(clean.types.from_layers, address_layers, 'address layers set');
t.end();
});
test('venue alias layer plus regular layers', function(t) {
var venue_layers = ['geoname','osmnode','osmway'];
var reg_layers = ['admin0', 'admin1'];
@ -63,6 +68,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
t.deepEqual(clean.types.from_layers, venue_layers.concat(reg_layers), 'venue + regular layers');
t.end();
});
test('coarse alias layer plus regular layers', function(t) {
var admin_layers = ['admin0','admin1','admin2','neighborhood','locality','local_admin'];
var reg_layers = ['geoname', 'osmnode', 'osmway'];
@ -75,6 +81,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
t.deepEqual(clean.types.from_layers, admin_layers.concat(reg_layers), 'coarse + regular layers set');
t.end();
});
test('address alias layer plus regular layers', function(t) {
var address_layers = ['osmaddress','openaddresses'];
var reg_layers = ['admin0', 'locality'];
@ -87,6 +94,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
t.deepEqual(clean.types.from_layers, address_layers.concat(reg_layers), 'address + regular layers set');
t.end();
});
test('alias layer plus regular layers (no duplicates)', function(t) {
var venue_layers = ['geoname','osmnode','osmway','admin0'];
var raw = { layers: 'venue,country' };
@ -97,6 +105,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
t.deepEqual(clean.types.from_layers, venue_layers, 'venue layers found (no duplicates)');
t.end();
});
test('multiple alias layers (no duplicates)', function(t) {
var alias_layers = ['geoname','osmnode','osmway','admin0','admin1','admin2','neighborhood','locality','local_admin'];
var raw = { layers: 'venue,coarse' };
@ -110,7 +119,6 @@ module.exports.tests.sanitize_layers = function(test, common) {
};
module.exports.all = function (tape, common) {
function test(name, testFunction) {
return tape('SANTIZE _layers ' + name, testFunction);
}

Loading…
Cancel
Save