Initial release
[websub-hub] / test / src / template / admin-topic-details-html.js
diff --git a/test/src/template/admin-topic-details-html.js b/test/src/template/admin-topic-details-html.js
new file mode 100644 (file)
index 0000000..52a8ed8
--- /dev/null
@@ -0,0 +1,36 @@
+/* eslint-env mocha */
+'use strict';
+
+const assert = require('assert');
+const template = require('../../../src/template/admin-topic-details-html');
+const Config = require('../../../config');
+const config = new Config('test');
+
+describe('Admin Topic Details HTML Template', function () {
+  let ctx;
+
+  beforeEach(function () {
+    ctx = {
+      topic: {},
+      subscriptions: [
+        {},
+      ],
+    };
+  });
+
+  it('renders', function () {
+    const result = template(ctx, config);
+    assert(result);
+  });
+  it('covers missing subscriptions', function () {
+    delete ctx.subscriptions;
+    const result = template(ctx, config);
+    assert(result);
+  });
+  it('covers plural subscriptions', function () {
+    ctx.subscriptions = [{}, {}, {}];
+    const result = template(ctx, config);
+    assert(result);
+  });
+
+});