Skip to content

Commit c7a8068

Browse files
committed
Add tests for plausible snippets
1 parent af7fca5 commit c7a8068

File tree

9 files changed

+32
-4
lines changed

9 files changed

+32
-4
lines changed

tests/docs/smoke-all/website/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.quarto/
2+
**/*.quarto_ipynb
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
project:
2+
type: website
3+
4+
website:
5+
title: "Plausible Custom Script Test"
6+
plausible-analytics: |
7+
<script async src="https://plausible.io/js/pa-TESTCODE123.js"></script>
8+
<script>
9+
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)};
10+
plausible.init()
11+
</script>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: "Plausible Custom Script Test"
3+
_quarto:
4+
tests:
5+
html:
6+
ensureHtmlElements:
7+
-
8+
- 'script[async][src="https://plausible.io/js/pa-TESTCODE123.js"]'
9+
ensureFileRegexMatches:
10+
- ['window\.plausible', 'plausible\.init']
11+
---
12+
13+
This test verifies that Plausible Analytics with custom script (pa-XXXX.js format)
14+
and initialization code is correctly injected into the HTML output.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.quarto/
2+
*.html
3+
*.json
4+
site_libs/
5+
**/*.quarto_ipynb

0 commit comments

Comments
 (0)