From f66afea3a5f3cd156a6effae6ebd9e9f5b9180dd Mon Sep 17 00:00:00 2001 From: Keegan Date: Sat, 6 Feb 2016 18:43:26 -0800 Subject: [PATCH] 100% code coverage! also move component registration to dev custom fn --- dev/custom-fn.js | 11 ++++++++++- src/scripts/config-page.js | 14 +------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/dev/custom-fn.js b/dev/custom-fn.js index 2d8af3a..58df1a4 100644 --- a/dev/custom-fn.js +++ b/dev/custom-fn.js @@ -6,7 +6,16 @@ module.exports = function() { var Clay = window.Clay = this; Clay.on(Clay.EVENTS.BEFORE_BUILD, function() { - console.debug('KEEGAN: BEFORE_BUILD', this); + + // register components here + this.registerComponent(require('pebble-clay-components').heading); + this.registerComponent(require('pebble-clay-components').text); + this.registerComponent(require('pebble-clay-components').footer); + this.registerComponent(require('pebble-clay-components').input); + this.registerComponent(require('pebble-clay-components').color); + this.registerComponent(require('pebble-clay-components').select); + this.registerComponent(require('pebble-clay-components').toggle); + this.registerComponent(require('pebble-clay-components').submit); }); Clay.on(Clay.EVENTS.AFTER_BUILD, function() { diff --git a/src/scripts/config-page.js b/src/scripts/config-page.js index 2426b2e..6d447a7 100755 --- a/src/scripts/config-page.js +++ b/src/scripts/config-page.js @@ -12,19 +12,7 @@ var customFn = window.customFn || function() {}; var $mainForm = $('#main-form'); var clayConfig = new ClayConfig(settings, config, $mainForm); -clayConfig.on(clayConfig.EVENTS.BEFORE_BUILD, function() { - - // register components here - this.registerComponent(require('pebble-clay-components').heading); - this.registerComponent(require('pebble-clay-components').text); - this.registerComponent(require('pebble-clay-components').footer); - this.registerComponent(require('pebble-clay-components').input); - this.registerComponent(require('pebble-clay-components').color); - this.registerComponent(require('pebble-clay-components').select); - this.registerComponent(require('pebble-clay-components').toggle); - this.registerComponent(require('pebble-clay-components').submit); -}); - +/* istanbul ignore next */ // @todo reassess how to do form submission clayConfig.on(clayConfig.EVENTS.AFTER_BUILD, function() { var self = this;