diff --git a/lib/index.js b/lib/index.js index f73661d..1c711d9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -99,12 +99,13 @@ Ctx.prototype.fetch = async function (options, cb) { }; // generates a function for the root list -function rootList (type) { - return function () { +function rootList (type, linkKey) { + return function (name) { var ctx = new Ctx(); ctx.type = "list"; - ctx.linkKey = type; + ctx.linkKey = linkKey ? linkKey : type; ctx.steps = [type]; + if (!!name) ctx.steps.push(name); return ctx; }; } @@ -319,3 +320,9 @@ function SeriesCtx (ctx) { subSteps(SeriesCtx, ['specifications']); exports.specificationseries = idStep(SeriesCtx, 'specification-series'); + +//------------------------------------- 12. Specifications by status + +exports.specificationsByStatus = rootList('specifications-by-status', 'specifications'); + + diff --git a/test/api.js b/test/api.js index 2c27083..f6dd8ce 100644 --- a/test/api.js +++ b/test/api.js @@ -235,6 +235,7 @@ describe('Call for translations', function () { }); }); + describe('Non-participant licensing commitments', function () { it("can be fetched", function (done) { w3c.nplcs().fetch(listChecker(done, 9252268, 'repoId')); @@ -244,6 +245,14 @@ describe('Non-participant licensing commitments', function () { }); }); + +describe('Specifications by status', function () { + it("can be listed", function (done) { + w3c.specificationsByStatus("Recommendation").fetch(listChecker(done, "Webmention")); + }); +}); + + describe("Embeds", function () { it('apply to functions', function (done) { w3c.functions().fetch({ embed: true }, embedChecker(done, 'name', 'Management'));