mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
test: cover runtime env guardrails (#1650)
* fix(data): restore bootstrap and cache test coverage * test: cover runtime env guardrails * fix(test): align security header tests with current vercel.json Update catch-all source pattern, geolocation policy value, and picture-in-picture origins to match current production config.
This commit is contained in:
@@ -63,7 +63,7 @@ describe('deploy/cache configuration guardrails', () => {
|
||||
});
|
||||
|
||||
const getSecurityHeaders = () => {
|
||||
const rule = vercelConfig.headers.find((entry) => entry.source === '/((?!docs).*)');
|
||||
const rule = vercelConfig.headers.find((entry) => entry.source === '/(.*)');
|
||||
return rule?.headers ?? [];
|
||||
};
|
||||
|
||||
@@ -93,7 +93,7 @@ describe('security header guardrails', () => {
|
||||
const expectedDisabled = [
|
||||
'camera=()',
|
||||
'microphone=()',
|
||||
'geolocation=(self)',
|
||||
'geolocation=()',
|
||||
'accelerometer=()',
|
||||
'bluetooth=()',
|
||||
'display-capture=()',
|
||||
@@ -123,11 +123,11 @@ describe('security header guardrails', () => {
|
||||
`Permissions-Policy should delegate ${api} to YouTube origins`
|
||||
);
|
||||
}
|
||||
// picture-in-picture also includes Cloudflare challenges
|
||||
// picture-in-picture delegates to self + YouTube
|
||||
assert.match(
|
||||
policy,
|
||||
/picture-in-picture=\(self "https:\/\/www\.youtube\.com" "https:\/\/www\.youtube-nocookie\.com" "https:\/\/challenges\.cloudflare\.com"\)/,
|
||||
'Permissions-Policy should delegate picture-in-picture to YouTube + Cloudflare origins'
|
||||
/picture-in-picture=\(self "https:\/\/www\.youtube\.com" "https:\/\/www\.youtube-nocookie\.com"\)/,
|
||||
'Permissions-Policy should delegate picture-in-picture to YouTube origins'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user