Files
MagicMirror/tests/e2e/ipWhitelist_spec.js
T

32 lines
837 B
JavaScript
Raw Normal View History

2022-10-07 19:16:37 +02:00
const helpers = require("./helpers/global-setup");
2017-07-24 22:08:12 +02:00
2022-10-04 10:15:24 +02:00
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
});
2022-10-04 10:15:24 +02:00
afterAll(async () => {
await helpers.stopApplication();
2017-03-07 21:22:27 -03:00
});
2021-04-08 21:12:56 +02:00
2022-10-04 10:15:24 +02:00
it("should return 403", async () => {
const res = await helpers.fetch("http://localhost:8080");
expect(res.status).toBe(403);
2017-03-07 16:21:15 -03:00
});
});
2017-03-07 21:22:27 -03:00
2022-10-04 10:15:24 +02:00
describe("Set ipWhitelist []", () => {
beforeAll(async () => {
await helpers.startApplication("tests/configs/empty_ipWhiteList.js");
2021-09-16 22:36:18 +02:00
});
2022-10-04 10:15:24 +02:00
afterAll(async () => {
await helpers.stopApplication();
2017-03-07 21:22:27 -03:00
});
2021-04-08 21:12:56 +02:00
2022-10-04 10:15:24 +02:00
it("should return 200", async () => {
const res = await helpers.fetch("http://localhost:8080");
expect(res.status).toBe(200);
2017-03-07 21:22:27 -03:00
});
});
2017-03-07 16:21:15 -03:00
});