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:
@@ -1,27 +1,32 @@
|
|||||||
import supertest from 'supertest';
|
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
|
let app;
|
||||||
const app = supertest.agent(HBApp).set('X-Forwarded-Proto', 'https');
|
let request;
|
||||||
|
|
||||||
|
beforeAll(async ()=>{
|
||||||
|
app = await createApp();
|
||||||
|
request = supertest.agent(app).set('X-Forwarded-Proto', 'https');
|
||||||
|
});
|
||||||
|
|
||||||
describe('Tests for static pages', ()=>{
|
describe('Tests for static pages', ()=>{
|
||||||
it('Home page works', ()=>{
|
it('Home page works', async ()=>{
|
||||||
return app.get('/').expect(200);
|
await request.get('/').expect(200);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Home page legacy works', ()=>{
|
it('Home page legacy works', async ()=>{
|
||||||
return app.get('/legacy').expect(200);
|
await request.get('/legacy').expect(200);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Changelog page works', ()=>{
|
it('Changelog page works', async ()=>{
|
||||||
return app.get('/changelog').expect(200);
|
await request.get('/changelog').expect(200);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('FAQ page works', ()=>{
|
it('FAQ page works', async ()=>{
|
||||||
return app.get('/faq').expect(200);
|
await request.get('/faq').expect(200);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('robots.txt works', ()=>{
|
it('robots.txt works', async ()=>{
|
||||||
return app.get('/robots.txt').expect(200);
|
await request.get('/robots.txt').expect(200);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user