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