add account settings page, rest of otp support, stdio credential helper, other misc
[squeep-authentication-module] / test / lib / template / ia-html.js
index 8bb1a6c4bd1f6826c99f2f9854000533b480b6b2..87bdf0a7070ff9be3f7d81a0224ecf4cf449d5f8 100644 (file)
@@ -3,14 +3,7 @@
 
 const assert = require('assert');
 const { IAHTML } = require('../../../lib/template');
-const stubLogger = require('../../stub-logger');
-const lint = require('html-minifier-lint').lint; // eslint-disable-line node/no-unpublished-require
-
-function lintHtml(html) {
-  const result = lint(html);
-  stubLogger.debug('validHtml', '', { result, html });
-  assert(!result);
-}
+const lintHtml = require('../../lint-html');
 
 describe('Template IAHTML', function () {
   let ctx, options;
@@ -26,16 +19,16 @@ describe('Template IAHTML', function () {
     };
   });
 
-  it('renders', function () {
+  it('renders', async function () {
     ctx.errors = ['an error', 'another error'];
     const result = IAHTML(ctx, options);
-    lintHtml(result);
+    await lintHtml(result);
     assert(result);
   });
 
-  it('covers empty error', function () {
+  it('covers empty error', async function () {
     const result = IAHTML(ctx, options);
-    lintHtml(result);
+    await lintHtml(result);
     assert(result);
   });