MagicMirror/tests/e2e/ipWhitelist_spec.js

32 lines
837 B
JavaScript
Raw Normal View History

const helpers = require("./helpers/global-setup");
describe("ipWhitelist directive configuration", () => {
describe("Set ipWhitelist without access", () => {
beforeAll(async () => {
await helpers.startApplication("tests/configs/noIpWhiteList.js");
2021-09-16 22:36:18 +02:00
});
afterAll(async () => {
await helpers.stopApplication();
});
2021-04-08 21:12:56 +02:00
it("should return 403", async () => {
const res = await helpers.fetch("http://localhost:8080");
expect(res.status).toBe(403);
});
});
describe("Set ipWhitelist []", () => {
beforeAll(async () => {
await helpers.startApplication("tests/configs/empty_ipWhiteList.js");
2021-09-16 22:36:18 +02:00
});
afterAll(async () => {
await helpers.stopApplication();
});
2021-04-08 21:12:56 +02:00
it("should return 200", async () => {
const res = await helpers.fetch("http://localhost:8080");
expect(res.status).toBe(200);
});
});
});