X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fsrc%2Ftemplate%2Fadmin-topic-details-html.js;h=823b439d695ecbe41566b40d91a38382fae433b4;hb=3bc885c4b6ef8e5ced2ee9708194523a41ebfe7a;hp=52a8ed8e8b50d9e86f378c6d69298109c4286708;hpb=9696c012e6b9a6c58904baa397ca0ebf78112316;p=websub-hub diff --git a/test/src/template/admin-topic-details-html.js b/test/src/template/admin-topic-details-html.js index 52a8ed8..823b439 100644 --- a/test/src/template/admin-topic-details-html.js +++ b/test/src/template/admin-topic-details-html.js @@ -4,10 +4,10 @@ const assert = require('assert'); const template = require('../../../src/template/admin-topic-details-html'); const Config = require('../../../config'); -const config = new Config('test'); +const lintHtml = require('../../lint-html'); describe('Admin Topic Details HTML Template', function () { - let ctx; + let ctx, config; beforeEach(function () { ctx = { @@ -16,21 +16,31 @@ describe('Admin Topic Details HTML Template', function () { {}, ], }; + config = new Config('test'); }); it('renders', function () { const result = template(ctx, config); + lintHtml(result); + assert(result); + }); + it('covers null topic', function () { + ctx.topic = null; + ctx.subscriptions = null; + const result = template(ctx, config); + lintHtml(result); assert(result); }); it('covers missing subscriptions', function () { delete ctx.subscriptions; const result = template(ctx, config); + lintHtml(result); assert(result); }); it('covers plural subscriptions', function () { ctx.subscriptions = [{}, {}, {}]; const result = template(ctx, config); + lintHtml(result); assert(result); }); - });