mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
32 lines
805 B
JavaScript
32 lines
805 B
JavaScript
const helpers = require("./global-setup");
|
|
|
|
describe("ipWhitelist directive configuration", () => {
|
|
describe("Set ipWhitelist without access", () => {
|
|
beforeAll(() => {
|
|
helpers.startApplication("tests/configs/noIpWhiteList.js");
|
|
});
|
|
afterAll(async () => {
|
|
await helpers.stopApplication();
|
|
});
|
|
|
|
it("should return 403", async () => {
|
|
const res = await helpers.fetch("http://localhost:8080");
|
|
expect(res.status).toBe(403);
|
|
});
|
|
});
|
|
|
|
describe("Set ipWhitelist []", () => {
|
|
beforeAll(() => {
|
|
helpers.startApplication("tests/configs/empty_ipWhiteList.js");
|
|
});
|
|
afterAll(async () => {
|
|
await helpers.stopApplication();
|
|
});
|
|
|
|
it("should return 200", async () => {
|
|
const res = await helpers.fetch("http://localhost:8080");
|
|
expect(res.status).toBe(200);
|
|
});
|
|
});
|
|
});
|