Skip to content

Commit

Permalink
fix markdown test to confirm to marked
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi committed Mar 3, 2021
1 parent 1cca9b8 commit 4f8ac5d
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions tests/spec/core/data-include-spec.js
Expand Up @@ -135,18 +135,19 @@ describe("Core — Data Include", () => {
body: `
<section id="abstract"></section>
<section data-include="${include}" data-include-format="markdown"></section>
<section id="test" data-include="${include}" data-include-format="markdown"></section>
`,
};
ops.abstract = null;

const doc = await makeRSDoc(ops);
const li = doc.querySelector("section li");
const li = doc.querySelector("section#test li");
expect(li).toBeTruthy();
expect(li.textContent).toContain("Rose");
expect(li.textContent).toContain("Blue");
expect(li.textContent).toContain("Red");
expect(li.textContent).toContain("wasteland");
expect(li.textContent).toBe("Rose");
const [p1, p2, p3] = [...doc.querySelectorAll("#test p")];
expect(p1.textContent).toContain("Blue");
expect(p2.textContent).toContain("Red");
expect(p3.textContent).toContain("wasteland");
// Shouldn't break other sections
expect(doc.getElementById("abstract")).toBeTruthy();
});
Expand All @@ -160,7 +161,7 @@ describe("Core — Data Include", () => {
body: `
<section id="abstract"></section>
<section>
<section id="test">
<div data-include="${include}" data-include-format="markdown" data-include-replace></div>
Expand All @@ -170,12 +171,13 @@ describe("Core — Data Include", () => {
ops.abstract = null;

const doc = await makeRSDoc(ops);
const li = doc.querySelector("section li");
const li = doc.querySelector("section#test li");
expect(li).toBeTruthy();
expect(li.textContent).toContain("Rose");
expect(li.textContent).toContain("Blue");
expect(li.textContent).toContain("Red");
expect(li.textContent).toContain("wasteland");
expect(li.textContent).toBe("Rose");
const [p1, p2, p3] = [...doc.querySelectorAll("#test p")];
expect(p1.textContent).toContain("Blue");
expect(p2.textContent).toContain("Red");
expect(p3.textContent).toContain("wasteland");
expect(li.parentElement.parentElement.localName).toBe("section");
// Shouldn't break other sections
expect(doc.getElementById("abstract")).toBeTruthy();
Expand Down

0 comments on commit 4f8ac5d

Please sign in to comment.