X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fsrc%2Ftemplate%2Fauthorization-error-html.js;h=2d1567f1767bf1dbb86819146a1b284937a157fc;hb=f0bf29c75b0fd405ff92fa76f058e61162b87e43;hp=ba92f30ed67c8367f35bee185dc9fbc3bda42a89;hpb=b0103b0d496262c438b40bc20304081dbfe41e73;p=squeep-indie-auther diff --git a/test/src/template/authorization-error-html.js b/test/src/template/authorization-error-html.js index ba92f30..2d1567f 100644 --- a/test/src/template/authorization-error-html.js +++ b/test/src/template/authorization-error-html.js @@ -5,15 +5,12 @@ const assert = require('assert'); const template = require('../../../src/template/authorization-error-html'); const Config = require('../../../config'); const StubLogger = require('../../stub-logger'); -const lint = require('html-minifier-lint').lint; // eslint-disable-line node/no-unpublished-require +const { makeHtmlLint } = require('@squeep/html-template-helper'); +const { HtmlValidate } = require('html-validate'); const stubLogger = new StubLogger(); - -function lintHtml(html) { - const result = lint(html); - stubLogger.debug('validHtml', '', { result, html }); - assert(!result); -} +const htmlValidate = new HtmlValidate(); +const lintHtml = makeHtmlLint(stubLogger, htmlValidate); describe('Authorization Error HTML Template', function () { let ctx, config; @@ -21,18 +18,18 @@ describe('Authorization Error HTML Template', function () { ctx = {}; config = new Config('test'); }); - it('renders', function () { + it('renders', async function () { const result = template(ctx, config); - lintHtml(result); + await lintHtml(result); assert(result); }); - it('renders errors', function () { + it('renders errors', async function () { ctx.session = { error: 'error_name', errorDescriptions: ['something went wrong', 'another thing went wrong'], - } + }; const result = template(ctx, config); - lintHtml(result); + await lintHtml(result); assert(result); }); }); // Authorization Error HTML Template