4 const assert
= require('assert');
5 const { LoginHTML
} = require('../../../lib/template');
6 const lintHtml
= require('../../lint-html');
8 describe('Template LoginHTML', function () {
10 beforeEach(function () {
12 clientProtocol: 'https',
16 authnEnabled: ['indieAuth', 'DEBUG_ANY'],
23 selfBaseUrl: 'https://example.com/',
28 it('covers', function () {
29 const result
= LoginHTML(ctx
, options
);
34 it('renders errors and additional content', function () {
35 ctx
.errors
= ['an error', 'another error'];
36 options
.manager
.logoUrl
= 'https://example.com/logo.png';
37 options
.authenticator
.loginBlurb
= ['<p>This is a login page.</p>'];
38 options
.authenticator
.indieAuthBlurb
= ['<p>Describe what IndieAuth allows one to do.</p>'];
39 options
.authenticator
.userBlurb
= ['<p>Describe user login.</p>'];
40 const result
= LoginHTML(ctx
, options
);
45 it('covers no indieAuth', function () {
46 options
.authenticator
.authnEnabled
= [];
47 const result
= LoginHTML(ctx
, options
);
52 it('covers insecure not allowed', function () {
53 ctx
.clientProtocol
= undefined;
54 const result
= LoginHTML(ctx
, options
);
59 it('covers insecure allowed', function () {
60 ctx
.clientProtocol
= 'http';
61 options
.authenticator
.secureAuthOnly
= false;
62 const result
= LoginHTML(ctx
, options
);