0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-26 09:32:51 +00:00
Files
homebrewery/tests/routes/static-pages.test.js
Alexey Sachkov 543d65f43f Add very first HTTP tests
Added tests for "static" pages like Home, Changelog, FAQ, etc.
2022-01-22 00:36:54 +03:00

30 lines
815 B
JavaScript

const supertest = require('supertest');
// Mimic https responses to avoid being redirected all the time
const app = supertest.agent(require('app.js').app)
.set('X-Forwarded-Proto', 'https');
describe('Tests for static pages', ()=>{
it('Home page works', ()=>{
return app.get('/').expect(200);
});
it('Home page v3 works', ()=>{
return app.get('/v3_preview').expect(200);
});
it('Changelog page works', ()=>{
return app.get('/changelog').expect(200);
});
it('FAQ page works', ()=>{
return app.get('/faq').expect(200);
});
// FIXME: robots.txt file can't be properly loaded under testing environment,
// most likely due to __dirname being different from what is expected
it.skip('robots.txt works', ()=>{
return app.get('/robots.txt').expect(200);
});
});