test("MDX With Helmet", () => { //expect.assertions(1); return get("/mdx/withhelmet").then(data => { const $ = cheerio.load(data); expect( $("head title") .text() .trim() ).toBe("Page Title"); }); });
test("React With Custom Meta Charset", () => { //expect.assertions(1); return get("/react/withcustomcharset").then(data => { const $ = cheerio.load(data); expect($("head [charset]").attr("charset")).toBe("ISO-8859-1"); }); });
test("React With SCSS Style", () => { //expect.assertions(1); return get("/react/withStyle").then(data => { const $ = cheerio.load(data); expect( $('head [rel="stylesheet"]') .attr("href") .endsWith("bundle.css") ).toBe(true); }); });
test("React With TypeScript", () => { //expect.assertions(1); return get("/react/typescript").then(data => { const $ = cheerio.load(data); expect($("b").text()).toBe("Hello TypeScript"); }); });
test("React With Imports", () => { //expect.assertions(1); return get("/vue/withimports").then(data => { const $ = cheerio.load(data); expect( $("body") .text() .trim() ).toBe("2, 4, 6"); }); });
test("Vue With asyncData", () => { //expect.assertions(1); return get("/vue/withAsyncData/?id=abc").then(data => { const $ = cheerio.load(data); expect( $("body") .text() .trim() ).toBe("abc"); }); });
test("HTML (Simple)", () => { //expect.assertions(1); return get("/html").then(data => { const $ = cheerio.load(data); expect( $("body h1") .text() .trim() ).toBe("Title"); }); });
test(".MDX File (With .JSX Import)", () => { //expect.assertions(1); return get("/mdx/withimportjsx").then(data => { const $ = cheerio.load(data); expect( $("body") .text() .trim() ).toBe("react-stateless"); }); });
// React Page test("React Stateless", () => { //expect.assertions(1); return get("/react/stateless").then(data => { const $ = cheerio.load(data); expect( $("body") .text() .trim() ).toBe("react-stateless"); }); });
test("React With Imports", () => { //expect.assertions(1); return get("/react/withimports").then(data => { const $ = cheerio.load(data); expect( $("body") .text() .trim() ).toBe("246react-stateless"); }); });
test("React With Class Properties", () => { //expect.assertions(1); return get("/react/withClassProperties").then(data => { const $ = cheerio.load(data); expect($("button").text()).toBe("Click Me!"); }); });
test("Svelte With Head", () => { //expect.assertions(1); return get("/svelte/withhead").then(data => { const $ = cheerio.load(data); expect( $("head title") .text() .trim() ).toBe("Page Title"); }); });
test("Svelte With Preloading", () => { //expect.assertions(1); return get("/svelte/withpreloading").then(data => { const $ = cheerio.load(data); expect( $("body p") .text() .trim() ).toBe("2,4,6"); }); });
// Vue Page test("Vue Simple", () => { //expect.assertions(1); return get("/vue/hello").then(data => { const $ = cheerio.load(data); expect( $("body") .text() .trim() ).toBe("Hello World!"); }); });
test("React With Default Meta Charset", () => { //expect.assertions(1); return get("/react/withhelmet").then(data => { const $ = cheerio.load(data); expect($("head [charset]").attr("charset")).toBe("utf-8"); }); });