Prepares the test site for the CMS host
The test route on the proxy Pi now points at the CMS host on port 5200. verify-deployment.sh gets a --cms mode that checks the exact security headers, caching, gzip only, a percent-encoded redirect, the 405 for POST, and the CMS routes. The deploy-test job uses it once the Gitea variable ASF_TEST_SERVED_BY_CMS is true. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -429,6 +429,37 @@ describe.skipIf(toolsMissing)('verify-deployment.sh', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('met --cms: weigert te starten zonder EXPECTED_CSP', async () => {
|
||||
const run = await runScript(
|
||||
'verify-deployment.sh',
|
||||
['http://127.0.0.1:9', dist, '--test', '--cms'],
|
||||
{ EXPECTED_CSP: '' },
|
||||
);
|
||||
expect(run.code).toBe(2);
|
||||
expect(run.stderr).toContain('EXPECTED_CSP');
|
||||
});
|
||||
|
||||
it('met --cms: meldt een afwijkende CSP en de ontbrekende CMS-routes', async () => {
|
||||
// De gewone stub is een nginx-achtige server: geen /health, /admin/
|
||||
// of API, en een andere CSP dan hier verwacht
|
||||
await withStub(
|
||||
{ behaviour: 'new', robots: true, gzip: true },
|
||||
async (origin) => {
|
||||
const run = await runScript(
|
||||
'verify-deployment.sh',
|
||||
[origin, dist, '--test', '--cms'],
|
||||
{ EXPECTED_CSP: "default-src 'none'" },
|
||||
);
|
||||
expect(run.code).toBe(1);
|
||||
expect(run.stderr).toContain(
|
||||
"header Content-Security-Policy is '",
|
||||
);
|
||||
expect(run.stderr).toContain('/health: status 404');
|
||||
expect(run.stderr).toContain('/admin/: status 301');
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('telt een verbroken verbinding als fout en eindigt met de samenvatting', async () => {
|
||||
await withStub(
|
||||
{ behaviour: 'new', drop: '/over-mij' },
|
||||
|
||||
Reference in New Issue
Block a user