X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Flib%2Ftemplate-helper.js;h=58985ccd962683f175f29a879a189d708b913335;hb=a2c0e2fc57bb8f25f694e16eb4e51d6970b28829;hp=ab5533faca6695fa1328b94089b0b11f3a878501;hpb=6f6bea9c4444979f564f7e2242dbd3504895a22e;p=squeep-html-template-helper
diff --git a/test/lib/template-helper.js b/test/lib/template-helper.js
index ab5533f..58985cc 100644
--- a/test/lib/template-helper.js
+++ b/test/lib/template-helper.js
@@ -21,6 +21,16 @@ describe('Template Helper', function () {
options = {};
});
+ describe('initContext', function () {
+ it('covers', function () {
+ th.initContext(ctx);
+ assert(ctx.errors);
+ assert(ctx.notifications);
+ assert(Array.isArray(ctx.errors));
+ assert(Array.isArray(ctx.notifications));
+ });
+ }); // initContext
+
describe('dateOrNot', function () {
let date, otherwise;
beforeEach(function () {
@@ -83,6 +93,26 @@ describe('Template Helper', function () {
});
}); // dateFormat
+ describe('timeElement', function () {
+ it('renders a date', function () {
+ const when = new Date('2022-09-11T21:17:56.872Z');
+ const expected = '';
+ const result = th.timeElement(when);
+ assert.strictEqual(result, expected);
+ });
+ it('covers title', function () {
+ const when = new Date('2022-09-11T21:17:56.872Z');
+ const expected = '';
+ const result = th.timeElement(when, { title: 'a date' });
+ assert.strictEqual(result, expected);
+ });
+ it('covers other', function () {
+ const expected = '';
+ const result = th.timeElement(1648420085049);
+ assert.strictEqual(result, expected);
+ });
+ }); // timeElement
+
describe('secondsToPeriod', function () {
it('covers seconds', function () {
const result = th.secondsToPeriod(45);