projects
/
websub-hub
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bump package version to 1.3.12
[websub-hub]
/
test
/
src
/
template
/
admin-topic-details-html.js
diff --git
a/test/src/template/admin-topic-details-html.js
b/test/src/template/admin-topic-details-html.js
index 52a8ed8e8b50d9e86f378c6d69298109c4286708..ce19af7d1b2b064997052c4c375d393fc965ed84 100644
(file)
--- a/
test/src/template/admin-topic-details-html.js
+++ b/
test/src/template/admin-topic-details-html.js
@@
-1,36
+1,49
@@
/* eslint-env mocha */
'use strict';
/* eslint-env mocha */
'use strict';
-const assert = require('assert');
+const assert = require('
node:
assert');
const template = require('../../../src/template/admin-topic-details-html');
const Config = require('../../../config');
const template = require('../../../src/template/admin-topic-details-html');
const Config = require('../../../config');
-const
config = new Config('test
');
+const
lintHtml = require('../../lint-html
');
describe('Admin Topic Details HTML Template', function () {
describe('Admin Topic Details HTML Template', function () {
- let ctx;
+ let ctx
, config
;
beforeEach(function () {
ctx = {
beforeEach(function () {
ctx = {
+ params: {
+ topicId: '97dd5488-a303-11ec-97ab-0025905f714a',
+ },
topic: {},
subscriptions: [
{},
],
};
topic: {},
subscriptions: [
{},
],
};
+ config = new Config('test');
});
});
- it('renders', function () {
+ it('renders',
async
function () {
const result = template(ctx, config);
const result = template(ctx, config);
+ await lintHtml(result);
assert(result);
});
assert(result);
});
- it('covers missing subscriptions', function () {
+ it('covers null topic', async function () {
+ ctx.topic = null;
+ ctx.subscriptions = null;
+ const result = template(ctx, config);
+ await lintHtml(result);
+ assert(result);
+ });
+ it('covers missing subscriptions', async function () {
delete ctx.subscriptions;
const result = template(ctx, config);
delete ctx.subscriptions;
const result = template(ctx, config);
+ await lintHtml(result);
assert(result);
});
assert(result);
});
- it('covers plural subscriptions', function () {
+ it('covers plural subscriptions',
async
function () {
ctx.subscriptions = [{}, {}, {}];
const result = template(ctx, config);
ctx.subscriptions = [{}, {}, {}];
const result = template(ctx, config);
+ await lintHtml(result);
assert(result);
});
assert(result);
});
-
});
});