scripts/mapping_geojson_to_osm_tags/tests/main.test.js

68 lines
2.0 KiB
JavaScript
Raw Normal View History

2023-08-05 09:55:14 +02:00
import mapping_engine from '../mappings/engine'
describe('mapping properties with rich mapping engine', () => {
test('do not add properties at all when there is nothing in tags of the mapping config', () => {
})
test('remove all properties when mapping says so', () => {
let mappingRemoveAll = {
config_name: 'testing config',
config_author: 'tykayn <contact@cipherbliss.com>',
default_properties_of_point: {
'amenity': 'charging_station'
},
tags: {
nom_amenageur: {
key_converted: 'wheelchair',
conditional_values: {
'Accessibilité inconnue': {
ignore_this_data: true, // ne pas ajouter de tag si la valeur est égale à Accessibilité inconnue.
},
}
}
}
}
let Mapping_engine = new mapping_engine(mappingRemoveAll)
let mapped_point = {}
list_of_points.forEach(feature_point => {
mapped_point = Mapping_engine.mapElementFromConf(feature_point)
})
expect(mapped_point.properties).toBeFalsy();
})
test('maps simple key to key, and keep the same value', () => { })
test('ignore one value', () => { })
test('conditional value', () => { })
test('conditional transform', () => { })
test('conditional truthy transform', () => { })
test('conditional falsy transform', () => { })
2023-07-31 22:30:55 +02:00
})
xdescribe('filters points', () => {
2023-08-05 09:55:14 +02:00
test('filter no points', () => { })
test('filter only one point', () => { })
test('filter X number of points', () => { })
test('filter city points', () => { })
test('filter bounding box', () => { })
test('filter combo, city', () => { })
test('filter combo, city + bbox', () => { })
test('filter combo, city + bbox + offset', () => { })
2023-07-31 22:30:55 +02:00
})
/**
* thats a roadmap, yes
*/
xdescribe('infer domain of values from csv file', () => {
2023-08-05 09:55:14 +02:00
test('gets the list of unique values in column', () => { })
2023-07-31 22:30:55 +02:00
})
xdescribe('infer domain of values from geojson file', () => {
2023-08-05 09:55:14 +02:00
test('gets the list of unique values in column', () => { })
2023-07-31 22:30:55 +02:00
})
xdescribe('build mapping engine config from unique values', () => {
2023-08-05 09:55:14 +02:00
test('builds a valid mapping config', () => { })
2023-07-31 22:30:55 +02:00
})