MagicMirror/tests/e2e/ipWhitelist_spec.js
Kristjan ESPERANTO 9d49196e69
Fix ipWhiteList test (#3181)
Port change seems to fix a timing issue.
2023-09-06 23:53:02 +02:00

32 lines
837 B
JavaScript

const helpers = require("./helpers/global-setup");
describe("ipWhitelist directive configuration", () => {
describe("Set ipWhitelist without access", () => {
beforeAll(async () => {
await helpers.startApplication("tests/configs/noIpWhiteList.js");
});
afterAll(async () => {
await helpers.stopApplication();
});
it("should return 403", async () => {
const res = await helpers.fetch("http://localhost:8181");
expect(res.status).toBe(403);
});
});
describe("Set ipWhitelist []", () => {
beforeAll(async () => {
await helpers.startApplication("tests/configs/empty_ipWhiteList.js");
});
afterAll(async () => {
await helpers.stopApplication();
});
it("should return 200", async () => {
const res = await helpers.fetch("http://localhost:8282");
expect(res.status).toBe(200);
});
});
});