mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
28 lines
1.3 KiB
JavaScript
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');
|
|
});
|
|
});
|
|
});
|
|
});
|