From 3a54a8b32fc4b2df3c15b1d2ad3e571b14c10a56 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 23 Sep 2015 19:00:33 +0200 Subject: [PATCH] fix label issues --- helper/labelGenerator.js | 22 ++- helper/labelSchema.json | 2 +- test/unit/helper/labelGenerator.js | 235 +++++++++++++++++++++++++++++ test/unit/run.js | 1 + 4 files changed, 247 insertions(+), 13 deletions(-) create mode 100644 test/unit/helper/labelGenerator.js diff --git a/helper/labelGenerator.js b/helper/labelGenerator.js index 3269fcf2..1938232d 100644 --- a/helper/labelGenerator.js +++ b/helper/labelGenerator.js @@ -1,9 +1,11 @@ -var schemas = require('./labelSchema.json'); +var _ = require('lodash'), + check = require('check-types'), + schemas = require('./labelSchema.json'); module.exports = function( record ){ - var adminParts = []; + var labelParts = [ record.name.default ]; var schema = schemas.default; @@ -13,9 +15,9 @@ module.exports = function( record ){ var buildOutput = function(parts, schemaArr, record) { for (var i=0; i