3bd561965d7d18983a435a1afe2f3e7f23592511
4 const assert
= require('assert');
5 const { SettingsHTML
} = require('../../../lib/template');
6 const lintHtml
= require('../../lint-html');
8 describe('Template SettingsHTML', function () {
10 beforeEach(function () {
14 otpBlurb: ['otp info'],
20 selfBaseUrl: 'https://example.com/',
25 it('renders, no otp', async
function () {
26 ctx
.errors
= ['an error', 'another error'];
27 ctx
.notifications
= ['a notice'];
28 const result
= SettingsHTML(ctx
, options
);
29 await
lintHtml(result
);
33 it('covers, otp', async
function () {
34 ctx
.otpKey
= '1234567890123456789012';
35 const result
= SettingsHTML(ctx
, options
);
36 await
lintHtml(result
);
40 it('covers, otp confirm', async
function () {
41 ctx
.otpConfirmKey
= '1234567890123456789012';
42 ctx
.otpConfirmBox
= 'boxboxbox';
43 ctx
.authenticationId
= 'identifier';
44 const result
= SettingsHTML(ctx
, options
);
45 await
lintHtml(result
);
49 it('covers empty error', async
function () {
50 const result
= SettingsHTML(ctx
, options
);
51 await
lintHtml(result
);