add account settings page, rest of otp support, stdio credential helper, other misc
[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', async function () {
26 ctx.errors = ['an error', 'another error'];
27 const result = OTPHTML(ctx, options);
28 await lintHtml(result);
29 assert(result);
30 });
31
32 it('covers empty error', async function () {
33 delete options.authenticator.otpBlurb;
34 const result = OTPHTML(ctx, options);
35 await lintHtml(result);
36 assert(result);
37 });
38
39 });