From 31263b7b22698e9bfd48440ef57f3a88103db6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Thu, 16 Aug 2018 13:55:39 +0200 Subject: [PATCH] Add unit test --- test/unit/cartodb/utils/date-wrapper.test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/unit/cartodb/utils/date-wrapper.test.js diff --git a/test/unit/cartodb/utils/date-wrapper.test.js b/test/unit/cartodb/utils/date-wrapper.test.js new file mode 100644 index 00000000..e4fab99a --- /dev/null +++ b/test/unit/cartodb/utils/date-wrapper.test.js @@ -0,0 +1,18 @@ +var assert = require('assert'); +var dateWrapper = require('../../../../lib/cartodb/utils/date-wrapper'); + +describe('date-wrapper', function() { + + it('should wrap property fields with spaces', function() { + const actual = dateWrapper.wrapDates( + 'select * from table', + [{name: 'a'}, {name: 'b c'}] + ); + const expected = ` + SELECT + "a","b c" + FROM + (select * from table) _cdb_epoch_transformation `; + assert.equal(actual, expected); + }); +});