You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Added `no CSP violations on page load` test to `build-validation.spec.js`
4
+
- Test listens for console warnings containing "Content Security Policy" and `net::ERR_BLOCKED_BY_CSP` request failures
5
+
- Would have caught the shields.io badge block before deployment
6
+
7
+
---
8
+
9
+
## Summary
10
+
Added a Playwright test to detect CSP violations at load time, closing the test coverage gap that let the shields.io badge block slip through.
11
+
12
+
---
13
+
14
+
## 1. CSP Violation Detection Test
15
+
**Files:**`tests/dev/build-validation.spec.js`
16
+
**What:** New test registers `console` and `requestfailed` listeners before page reload, collects any CSP-related warnings or blocked requests during a 5-second observation window, then asserts no violations occurred.
17
+
**Impact:** Any future CSP misconfiguration (missing domain in `img-src`, `script-src`, `connect-src`, etc.) will be caught automatically by the test suite.
18
+
19
+
---
20
+
21
+
## Files Changed (1 total)
22
+
23
+
| File | Lines Changed | Type |
24
+
|------|:---:|------|
25
+
|`tests/dev/build-validation.spec.js`| +28 | Test |
0 commit comments