Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/smoke/render/render-title-block.test.ts
12925 views
1
/*
2
* render-title-block.test.ts
3
*
4
* Copyright (C) 2020-2022 Posit Software, PBC
5
*
6
*/
7
8
import { docs, outputForInput } from "../../utils.ts";
9
import { ensureFileRegexMatches, ensureHtmlElements } from "../../verify.ts";
10
import { testRender } from "./render.ts";
11
12
const input = docs("doc-layout/title-block.qmd");
13
const htmlOutput = outputForInput(input, "html");
14
testRender(input, "html", false, [
15
ensureHtmlElements(htmlOutput.outputPath, [
16
"div.quarto-title",
17
"p.subtitle",
18
"div.quarto-categories",
19
"div.quarto-title-meta",
20
], []),
21
]);
22
23
const noneInput = docs("doc-layout/title-block-none.qmd");
24
const noneOutput = outputForInput(noneInput, "html");
25
testRender(noneInput, "html", false, [
26
ensureHtmlElements(noneOutput.outputPath, [
27
"p.author",
28
"p.date",
29
"#title-block-header",
30
], ["div.quarto-title"]),
31
ensureFileRegexMatches(noneOutput.outputPath, [/Nora Jones/], [/Published/]),
32
]);
33
34
const bannerInput = docs("doc-layout/title-block-banner.qmd");
35
const bannerOutput = outputForInput(bannerInput, "html");
36
testRender(bannerInput, "html", false, [
37
ensureHtmlElements(bannerOutput.outputPath, [
38
"main.quarto-banner-title-block",
39
".quarto-title-banner .quarto-title.column-body",
40
"header#title-block-header",
41
".title",
42
".quarto-categories",
43
]),
44
ensureFileRegexMatches(bannerOutput.outputPath, [/Nora Jones/], [/\[true\]/]),
45
]);
46
47