4 const assert
= require('assert');
5 const { SettingsHTML
} = require('../../../lib/template');
6 const stubLogger
= require('../../stub-logger');
7 const lintHtml
= require('../../lint-html');
9 describe('Template SettingsHTML', function () {
11 beforeEach(function () {
15 otpBlurb: ['otp info'],
21 selfBaseUrl: 'https://example.com/',
26 it('renders, no otp', async
function () {
27 ctx
.errors
= ['an error', 'another error'];
28 ctx
.notifications
= ['a notice']
29 const result
= SettingsHTML(ctx
, options
);
30 await
lintHtml(result
);
34 it('covers, otp', async
function () {
35 ctx
.otpKey
= '1234567890123456789012';
36 const result
= SettingsHTML(ctx
, options
);
37 await
lintHtml(result
);
41 it('covers, otp confirm', async
function () {
42 ctx
.otpConfirmKey
= '1234567890123456789012';
43 ctx
.otpConfirmBox
= 'boxboxbox';
44 ctx
.authenticationId
= 'identifier';
45 const result
= SettingsHTML(ctx
, options
);
46 await
lintHtml(result
);
50 it('covers empty error', async
function () {
51 const result
= SettingsHTML(ctx
, options
);
52 await
lintHtml(result
);