X-Git-Url: http://git.squeep.com/?p=websub-hub;a=blobdiff_plain;f=test%2Fsrc%2Ftemplate%2Ftemplate-helper.js;fp=test%2Fsrc%2Ftemplate%2Ftemplate-helper.js;h=8c8579d1cc5a83b3d65b8acd2c232805d61097a8;hp=3ad7f83812a3c3c8c5f46b7e32360837c059f338;hb=3c547e314b79a31fb3f15412a47707a22dc3eefd;hpb=4807a77eca2858e8dc23d9ec2247a778814988d7 diff --git a/test/src/template/template-helper.js b/test/src/template/template-helper.js index 3ad7f83..8c8579d 100644 --- a/test/src/template/template-helper.js +++ b/test/src/template/template-helper.js @@ -3,67 +3,8 @@ const assert = require('assert'); const th = require('../../../src/template/template-helper'); -const Config = require('../../../config'); -const config = new Config('test'); describe('Template Helper', function () { - let ctx; - - beforeEach(function () { - ctx = {}; - }); - - describe('dateOrNot', function () { - let date, otherwise; - beforeEach(function () { - date = new Date(); - otherwise = 'otherwise'; - }); - it('covers', function () { - const result = th.dateOrNot(date, otherwise); - assert.strictEqual(result, date.toString()); - }); - it('covers no date', function () { - date = undefined; - const result = th.dateOrNot(date, otherwise); - assert.strictEqual(result, otherwise); - }); - it('covers ms', function () { - const result = th.dateOrNot(date.getTime(), otherwise); - assert.strictEqual(result, date.toString()); - }); - it('covers naught', function () { - const result = th.dateOrNot(0, otherwise); - assert.strictEqual(result, otherwise); - }); - it('covers the infinite', function () { - const result = th.dateOrNot(-Infinity, otherwise); - assert.strictEqual(result, otherwise); - }); - }); // dateOrNot - - describe('secondsToPeriod', function () { - it('covers seconds', function () { - const result = th.secondsToPeriod(45); - assert.strictEqual(result, '45 seconds'); - }); - it('covers minutes', function () { - const result = th.secondsToPeriod(105); - assert.strictEqual(result, '1 minute 45 seconds'); - }); - it('covers hours', function () { - const result = th.secondsToPeriod(3705); - assert.strictEqual(result, '1 hour 1 minute 45 seconds'); - }); - it('covers days', function () { - const result = th.secondsToPeriod(90105); - assert.strictEqual(result, '1 day 1 hour 1 minute 45 seconds'); - }); - it('covers months', function () { - const result = th.secondsToPeriod(5274105); - assert.strictEqual(result, '2 months 1 day 1 hour 1 minute 45 seconds'); - }); - }); // secondsToPeriod describe('renderTopicRow', function () { let topic, subscribers; @@ -122,115 +63,4 @@ describe('Template Helper', function () { }); }); // renderSubscriptionRowHeader - describe('htmlHead', function () { - let pagePathLevel, pageTitle, headElements; - beforeEach(function () { - pagePathLevel = 2; - pageTitle = 'title'; - }); - it('covers', function () { - const result = th.htmlHead(pagePathLevel, pageTitle, headElements); - assert(result); - }); - it('covers elements', function () { - headElements = [ '