rudimentary support for totp 2fa
[squeep-authentication-module] / test / lib / template / otp-html.js
diff --git a/test/lib/template/otp-html.js b/test/lib/template/otp-html.js
new file mode 100644 (file)
index 0000000..5aa3d8b
--- /dev/null
@@ -0,0 +1,38 @@
+/* eslint-env mocha */
+'use strict';
+
+const assert = require('assert');
+const { OTPHTML } = require('../../../lib/template');
+const lintHtml = require('../../lint-html');
+
+describe('Template OTPHTML', function () {
+  let ctx, options;
+  beforeEach(function () {
+    ctx = {};
+    options = {
+      authenticator: {
+        otpBlurb: ['otp info'],
+      },
+      manager: {
+        pageTitle: 'page',
+      },
+      dingus: {
+        selfBaseUrl: 'https://example.com/',
+      },
+    };
+  });
+
+  it('renders', function () {
+    ctx.errors = ['an error', 'another error'];
+    const result = OTPHTML(ctx, options);
+    lintHtml(result);
+    assert(result);
+  });
+
+  it('covers empty error', function () {
+    const result = OTPHTML(ctx, options);
+    lintHtml(result);
+    assert(result);
+  });
+
+});
\ No newline at end of file