camel case

This commit is contained in:
Daniel García Aubert 2019-11-13 19:36:30 +01:00
parent 2c8a030ecb
commit 602ab44375

View File

@ -66,14 +66,14 @@ describe('server', function () {
it('grid jsonp', function (done) { it('grid jsonp', function (done) {
var mapConfig = testClient.singleLayerMapConfig('select * from test_table', null, null, 'name'); var mapConfig = testClient.singleLayerMapConfig('select * from test_table', null, null, 'name');
testClient.getGridJsonp(mapConfig, 0, 13, 4011, 3088, 'jsonp_test', function (err, res) { testClient.getGridJsonp(mapConfig, 0, 13, 4011, 3088, 'jsonpTest', function (err, res) {
assert.ifError(err); assert.ifError(err);
assert.strictEqual(res.statusCode, 200, res.body); assert.strictEqual(res.statusCode, 200, res.body);
assert.deepStrictEqual(res.headers['content-type'], 'text/javascript; charset=utf-8'); assert.deepStrictEqual(res.headers['content-type'], 'text/javascript; charset=utf-8');
var didRunJsonCallback = false; var didRunJsonCallback = false;
var response = {}; var response = {};
/* eslint-disable no-unused-vars, no-eval */ /* eslint-disable no-unused-vars, no-eval */
function jsonp_test (body) { function jsonpTest (body) {
response = body; response = body;
didRunJsonCallback = true; didRunJsonCallback = true;
} }
@ -88,14 +88,14 @@ describe('server', function () {
var mapConfig = testClient.singleLayerMapConfig('select * from test_table', null, null, 'name'); var mapConfig = testClient.singleLayerMapConfig('select * from test_table', null, null, 'name');
testClient.getGrid(mapConfig, 0, 13, 4011, 3088, function (err, res) { testClient.getGrid(mapConfig, 0, 13, 4011, 3088, function (err, res) {
assert.ifError(err); assert.ifError(err);
var expected_json = { var expectedJson = {
1: { name: 'Hawai' }, 1: { name: 'Hawai' },
2: { name: 'El Estocolmo' }, 2: { name: 'El Estocolmo' },
3: { name: 'El Rey del Tallarín' }, 3: { name: 'El Rey del Tallarín' },
4: { name: 'El Lacón' }, 4: { name: 'El Lacón' },
5: { name: 'El Pico' } 5: { name: 'El Pico' }
}; };
assert.deepStrictEqual(JSON.parse(res.body).data, expected_json); assert.deepStrictEqual(JSON.parse(res.body).data, expectedJson);
done(); done();
}); });
}); });
@ -157,14 +157,14 @@ describe('server', function () {
var mapConfigName = testClient.singleLayerMapConfig(query, style211, null, 'name'); var mapConfigName = testClient.singleLayerMapConfig(query, style211, null, 'name');
testClient.getGrid(mapConfigName, 0, 3, 2, 2, function (err, res) { testClient.getGrid(mapConfigName, 0, 3, 2, 2, function (err, res) {
assert.ifError(err); assert.ifError(err);
var expected_data = { 1: { name: 'west' } }; var expectedData = { 1: { name: 'west' } };
assert.deepStrictEqual(JSON.parse(res.body).data, expected_data); assert.deepStrictEqual(JSON.parse(res.body).data, expectedData);
var mapConfigCartodbId = testClient.singleLayerMapConfig(query, style211, null, 'cartodb_id'); var mapConfigCartodbId = testClient.singleLayerMapConfig(query, style211, null, 'cartodb_id');
testClient.getGrid(mapConfigCartodbId, 0, 3, 2, 2, function (err, res) { testClient.getGrid(mapConfigCartodbId, 0, 3, 2, 2, function (err, res) {
assert.ifError(err); assert.ifError(err);
var expected_data = { 1: { cartodb_id: 1 } }; var expectedData = { 1: { cartodb_id: 1 } };
assert.deepStrictEqual(JSON.parse(res.body).data, expected_data); assert.deepStrictEqual(JSON.parse(res.body).data, expectedData);
done(); done();
}); });
}); });