1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
letu/test/test-pages.js

39 lines
787 B
JavaScript
Raw Normal View History

2020-06-08 12:20:17 +02:00
let request = require("supertest");
let wipeDatabase = require("./utils/wipeDatabase");
async function setup() {
let app = require("../app");
let models = require("../models");
await models.sequelize.sync();
await wipeDatabase(models);
return [app, models];
}
async function clean() {
await wipeDatabase(models);
await models.sequelize.close();
for (let e of ["../app", "../models"])
delete require.cache[require.resolve(e)];
}
before(async () => {
[app, models] = await setup();
2020-12-12 18:20:02 +01:00
});
2020-06-08 12:20:17 +02:00
it("Main page content", async () => {
await request(app)
.get("/")
2020-11-02 13:53:42 +01:00
.expect(302);
});
it("Login page content", async () => {
await request(app)
.get("/login")
2020-06-08 12:20:17 +02:00
.expect(200);
});
after(() => {
return clean;
});