0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-03-22 06:48:11 +00:00

fix static pages tests

This commit is contained in:
Víctor Losada Hernández
2026-02-24 21:58:09 +01:00
parent 86a03fd0bf
commit 735c8cb917

View File

@@ -1,27 +1,32 @@
import supertest from 'supertest';
import HBApp from 'app.js';
import createApp from '../../server/app.js';
// Mimic https responses to avoid being redirected all the time
const app = supertest.agent(HBApp).set('X-Forwarded-Proto', 'https');
let app;
let request;
beforeAll(async ()=>{
app = await createApp();
request = supertest.agent(app).set('X-Forwarded-Proto', 'https');
});
describe('Tests for static pages', ()=>{
it('Home page works', ()=>{
return app.get('/').expect(200);
it('Home page works', async ()=>{
await request.get('/').expect(200);
});
it('Home page legacy works', ()=>{
return app.get('/legacy').expect(200);
it('Home page legacy works', async ()=>{
await request.get('/legacy').expect(200);
});
it('Changelog page works', ()=>{
return app.get('/changelog').expect(200);
it('Changelog page works', async ()=>{
await request.get('/changelog').expect(200);
});
it('FAQ page works', ()=>{
return app.get('/faq').expect(200);
it('FAQ page works', async ()=>{
await request.get('/faq').expect(200);
});
it('robots.txt works', ()=>{
return app.get('/robots.txt').expect(200);
it('robots.txt works', async ()=>{
await request.get('/robots.txt').expect(200);
});
});