File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
tests/docs/smoke-all/website-search/algolia-with-consent-implied Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ /.quarto /
2+ ** /* .quarto_ipynb
Original file line number Diff line number Diff line change 1+ project :
2+ type : website
3+
4+ website :
5+ title : " Algolia With Cookie Consent Test"
6+ search :
7+ algolia :
8+ application-id : " TEST_APP_ID"
9+ search-only-api-key : " TEST_API_KEY"
10+ index-name : " test-index"
11+ analytics-events : true
12+ cookie-consent :
13+ type : implied
14+
15+ format :
16+ html :
17+ theme : cosmo
Original file line number Diff line number Diff line change 1+ ---
2+ title : " Algolia Search With Cookie Consent"
3+ _quarto :
4+ tests :
5+ html :
6+ ensureHtmlElements :
7+ -
8+ # Ensure search options script exists
9+ - ' script#quarto-search-options'
10+ # Cookie consent element are loaded
11+ - script[src$='cookie-consent.js']
12+ ensureFileRegexMatches :
13+ -
14+ # Cookie consent should be enabled
15+ - ' "cookie-consent-enabled":\s*true'
16+ # Scripts should be deferred with cookie-consent attribute
17+ - ' type="text/plain"[^>]*cookie-consent="tracking"[^>]*>[\s\S]*search-insights'
18+ # type should be implied per config
19+ - ' cookieconsent.run\(\{[^}]*"consent_type":"implied"'
20+ ---
21+
22+ This test verifies that when ` cookie-consent ` is configured in the website settings:
23+
24+ 1 . The Algolia search options JSON contains ` "cookie-consent-enabled": true `
25+ 2 . Algolia Insights scripts are deferred with ` type="text/plain" cookie-consent="tracking" `
26+ 3 . Scripts only execute after user grants "tracking" consent
27+ 4 . Cookie consent UI elements are present on the page
You can’t perform that action at this time.
0 commit comments