Skip to content

Commit fb61d6e

Browse files
committed
test: render the pagination warning from its own fixture
1 parent 9837890 commit fb61d6e

7 files changed

Lines changed: 48 additions & 9 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.quarto/
2+
**/*.quarto_ipynb
3+
/_site/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
project:
2+
type: website
3+
4+
website:
5+
title: "Pagination warning"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Pagination Warning Test
3+
listing:
4+
id: warned
5+
contents: posts
6+
type: default
7+
page-size: 1
8+
sort: title
9+
pagination:
10+
inner-window: 0
11+
outer-window: 1
12+
---
13+
14+
::: {#warned}
15+
:::
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Test Post 1
3+
date: 2026-01-01
4+
---
5+
6+
Content for test post 1.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Test Post 2
3+
date: 2026-01-02
4+
---
5+
6+
Content for test post 2.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Test Post 3
3+
date: 2026-01-03
4+
---
5+
6+
Content for test post 3.

‎tests/smoke/site/render-listing-pagination.test.ts‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,20 @@ import { join } from "../../../src/deno_ral/path.ts";
77
import { removeIfExists } from "../../../src/core/path.ts";
88
import { testQuartoCmd } from "../../test.ts";
99
import { docs } from "../../utils.ts";
10-
import { ensureHtmlElements, printsMessage } from "../../verify.ts";
10+
import { ensureFileRegexMatches, printsMessage } from "../../verify.ts";
1111

12-
const projectDir = docs("playwright/listings/pagination");
12+
const projectDir = docs("listings/pagination-warning");
1313
const outputDir = join(projectDir, "_site");
1414

1515
testQuartoCmd("render", [projectDir], [
1616
printsMessage({
1717
level: "WARN",
18-
regex: /Listing 'invalid': pagination option 'inner-window'/,
18+
regex: /Listing 'warned': pagination option 'inner-window'/,
1919
}),
20-
ensureHtmlElements(join(outputDir, "index.html"), [
21-
"nav#absent-pagination.listing-pagination",
22-
"nav#left-pagination.listing-pagination",
23-
"nav#outer-pagination.listing-pagination",
24-
"nav#mixed-pagination.listing-pagination",
25-
"nav#invalid-pagination.listing-pagination",
20+
ensureFileRegexMatches(join(outputDir, "index.html"), [
21+
/pagination: \{ left: 1, right: 1, item:/,
22+
], [
23+
/innerWindow/,
2624
]),
2725
], {
2826
name: "Listing pagination options are checked at render time",

0 commit comments

Comments
 (0)