Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
fix(w3c/templates/headers): export details open (speced#3869)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres authored Nov 9, 2021
1 parent c12a12f commit f356699
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/w3c/templates/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function getSpecSubTitleElem(conf) {
*/
sub("beforesave", doc => {
const details = doc.querySelector(".head details");
details.removeAttribute("open");
details.open = true;
});

export default (conf, options) => {
Expand Down
5 changes: 2 additions & 3 deletions tests/spec/w3c/headers-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@ describe("W3C — Headers", () => {
expect(dl).toBeTruthy();
});

it("removes the open attribute from details on save", async () => {
it("sets the open attribute from details on save", async () => {
const opts = makeStandardOps({ specStatus: "WD" });
const doc = await makeRSDoc(opts);
doc.querySelector(".head details").open = true;
const exportedDoc = new DOMParser().parseFromString(
await doc.respec.toHTML(),
"text/html"
);
const details = exportedDoc.querySelector(".head details");
expect(details.hasAttribute("open")).toBeFalsy();
expect(exportedDoc.querySelector(".head details[open]")).toBeTruthy();
});

it("links to the 'kinds of documents' only for W3C documents", async () => {
Expand Down

0 comments on commit f356699

Please sign in to comment.