X-Git-Url: https://git.squeep.com/?p=squeep-authentication-module;a=blobdiff_plain;f=test%2Flib%2Ftemplate%2Fotp-html.js;fp=test%2Flib%2Ftemplate%2Fotp-html.js;h=5aa3d8bc6a812b04214f8139090e4ece5a882f3d;hp=0000000000000000000000000000000000000000;hb=2ca511865b0caf3108819cfd6ee775124ea70dff;hpb=8b998e55749e8613c0dece7a156b5edf83fb3608 diff --git a/test/lib/template/otp-html.js b/test/lib/template/otp-html.js new file mode 100644 index 0000000..5aa3d8b --- /dev/null +++ b/test/lib/template/otp-html.js @@ -0,0 +1,38 @@ +/* eslint-env mocha */ +'use strict'; + +const assert = require('assert'); +const { OTPHTML } = require('../../../lib/template'); +const lintHtml = require('../../lint-html'); + +describe('Template OTPHTML', function () { + let ctx, options; + beforeEach(function () { + ctx = {}; + options = { + authenticator: { + otpBlurb: ['otp info'], + }, + manager: { + pageTitle: 'page', + }, + dingus: { + selfBaseUrl: 'https://example.com/', + }, + }; + }); + + it('renders', function () { + ctx.errors = ['an error', 'another error']; + const result = OTPHTML(ctx, options); + lintHtml(result); + assert(result); + }); + + it('covers empty error', function () { + const result = OTPHTML(ctx, options); + lintHtml(result); + assert(result); + }); + +}); \ No newline at end of file