mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-03-22 04:38:11 +00:00
fix static pages tests
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user