update dependencies and devDependencies, fix lint issues
[squeep-indie-auther] / test / src / template / authorization-error-html.js
1 'use strict';
2
3 const assert = require('assert');
4 const template = require('../../../src/template/authorization-error-html');
5 const Config = require('../../../config');
6 const StubLogger = require('../../stub-logger');
7 const { makeHtmlLint } = require('@squeep/html-template-helper');
8 const { HtmlValidate } = require('html-validate');
9
10 const stubLogger = new StubLogger();
11 const htmlValidate = new HtmlValidate();
12 const lintHtml = makeHtmlLint(stubLogger, htmlValidate);
13
14 describe('Authorization Error HTML Template', function () {
15 let ctx, config;
16 beforeEach(function () {
17 ctx = {};
18 config = new Config('test');
19 });
20 it('renders', async function () {
21 const result = template(ctx, config);
22 await lintHtml(result);
23 assert(result);
24 });
25 it('renders errors', async function () {
26 ctx.session = {
27 error: 'error_name',
28 errorDescriptions: ['something went wrong', 'another thing went wrong'],
29 };
30 const result = template(ctx, config);
31 await lintHtml(result);
32 assert(result);
33 });
34 }); // Authorization Error HTML Template