Commit 7068e28d authored by Nellie McKesson's avatar Nellie McKesson

adjusting target-text spec to work with new nth-of-type handling

parent 6f744438
......@@ -14,27 +14,27 @@ describe("target-text", () => {
});
it("Table of content should include chapter titles", async () => {
let text = await page.$eval("nav li:nth-of-type(1) a" , (r) => window.getComputedStyle(r, "::after").content);
let text = await page.$eval("nav li#first a" , (r) => window.getComputedStyle(r, "::after").content);
expect(text).toEqual("\"'Lorem \\\"ipsum\\\" dolor sit amet'\"");
});
it("Table of content should include chapter titles", async () => {
let text = await page.$eval("nav li:nth-of-type(2) a" , (r) => window.getComputedStyle(r, "::after").content);
let text = await page.$eval("nav li#second a" , (r) => window.getComputedStyle(r, "::after").content);
expect(text).toEqual("\"'Lorem ipsum dolor sit amet'\"");
});
it("Table of content should include first-letter of the chapter title", async () => {
let text = await page.$eval("nav li:nth-of-type(3) a" , (r) => window.getComputedStyle(r, "::after").content);
let text = await page.$eval("nav li#third a" , (r) => window.getComputedStyle(r, "::after").content);
expect(text).toEqual("\"P\"");
});
it("Table of content should include the content of the before pseudo element", async () => {
let text = await page.$eval("nav li:nth-of-type(4) a" , (r) => window.getComputedStyle(r, "::after").content);
let text = await page.$eval("nav li#fourth a" , (r) => window.getComputedStyle(r, "::after").content);
expect(text).toEqual("\"This is 'inside' the before:\"");
});
it("Table of content should include the content of the before pseudo element", async () => {
let text = await page.$eval("nav li:nth-of-type(5) a" , (r) => window.getComputedStyle(r, "::after").content);
let text = await page.$eval("nav li#fifth a" , (r) => window.getComputedStyle(r, "::after").content);
expect(text).toEqual("\": This is inside the after\"");
});
// if (!DEBUG) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment