MagicMirror/tests/e2e/ipWhistlist_spec.js
Rodrigo Ramírez Norambuena a15b8077a3 Add test without access by ipWhistelist
This test set a invalid IP address for not have access to MagicMirror.
Creates a request to localhost and port added in configuration and check if
gets 403 HTTP code.
2017-03-07 19:50:19 -03:00

31 lines
719 B
JavaScript

const globalSetup = require("./global-setup");
const app = globalSetup.app;
const request = require("request");
const chai = require("chai");
const expect = chai.expect;
describe("Set ipWhitelist without access", function () {
this.timeout(20000);
before(function() {
// Set config sample for use in test
process.env.MM_CONFIG_FILE = "tests/configs/noIpWhiteList.js";
});
beforeEach(function (done) {
app.start().then(function() { done(); } );
});
afterEach(function (done) {
app.stop().then(function() { done(); });
});
it("should return 403", function (done) {
request.get("http://localhost:8080", function (err, res, body) {
expect(res.statusCode).to.equal(403);
done();
});
});
});