rudimentary support for totp 2fa
[squeep-authentication-module] / test / lib / template / otp-html.js
1 /* eslint-env mocha */
2 'use strict';
3
4 const assert = require('assert');
5 const { OTPHTML } = require('../../../lib/template');
6 const lintHtml = require('../../lint-html');
7
8 describe('Template OTPHTML', function () {
9 let ctx, options;
10 beforeEach(function () {
11 ctx = {};
12 options = {
13 authenticator: {
14 otpBlurb: ['otp info'],
15 },
16 manager: {
17 pageTitle: 'page',
18 },
19 dingus: {
20 selfBaseUrl: 'https://example.com/',
21 },
22 };
23 });
24
25 it('renders', function () {
26 ctx.errors = ['an error', 'another error'];
27 const result = OTPHTML(ctx, options);
28 lintHtml(result);
29 assert(result);
30 });
31
32 it('covers empty error', function () {
33 const result = OTPHTML(ctx, options);
34 lintHtml(result);
35 assert(result);
36 });
37
38 });