wrolpi/app/cypress/e2e/caddy-media.cy.js
Roland 1e37f0d4dd
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Controller Tests / controller-tests (push) Has been cancelled
Jest Tests / jest-tests (push) Has been cancelled
Skipping Caddy tests on CICD.
2026-03-10 20:30:46 -06:00

28 lines
1.3 KiB
JavaScript

// These tests require Caddy (not available in CI where only React dev server runs)
(Cypress.env('CI') ? describe.skip : describe)('Caddy Media Serving Tests', () => {
describe('/media/ Content-Disposition inline', () => {
it('sets Content-Disposition inline on /media/ file requests', () => {
cy.request('GET', '/media/config/wrolpi.yaml').then((response) => {
expect(response.status).to.eq(200);
expect(response.headers['content-disposition']).to.contain('inline');
});
});
it('serves .yaml files with text/yaml Content-Type', () => {
cy.request('GET', '/media/config/wrolpi.yaml').then((response) => {
expect(response.status).to.eq(200);
expect(response.headers['content-type']).to.contain('text/yaml');
});
});
});
describe('/download/ Content-Disposition attachment', () => {
it('sets Content-Disposition attachment on /download/ file requests', () => {
cy.request('GET', '/download/config/wrolpi.yaml').then((response) => {
expect(response.status).to.eq(200);
expect(response.headers['content-disposition']).to.contain('attachment');
});
});
});
});