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