Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for fetching specifications by status #88

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ Ctx.prototype.fetch = 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;
};
}
Expand Down Expand Up @@ -309,3 +310,9 @@ function SeriesCtx (ctx) {
subSteps(SeriesCtx, ['specifications']);

exports.specificationseries = idStep(SeriesCtx, 'specification-series');

//------------------------------------- 12. Specifications by status

exports.specificationsByStatus = rootList('specifications-by-status', 'specifications');


9 changes: 9 additions & 0 deletions test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand All @@ -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'));
Expand Down