MagicMirror/tests/e2e/env_spec.js

28 lines
839 B
JavaScript
Raw Normal View History

const helpers = require("./helpers/global-setup");
describe("App environment", () => {
beforeAll(async () => {
2021-09-25 23:45:34 +02:00
helpers.startApplication("tests/configs/default.js");
await helpers.getDocument();
2017-01-30 12:29:32 -03:00
});
afterAll(async () => {
await helpers.stopApplication();
2017-01-30 12:29:32 -03:00
});
it("get request from http://localhost:8080 should return 200", async () => {
const res = await helpers.fetch("http://localhost:8080");
expect(res.status).toBe(200);
});
it("get request from http://localhost:8080/nothing should return 404", async () => {
const res = await helpers.fetch("http://localhost:8080/nothing");
expect(res.status).toBe(404);
});
it("should show the title MagicMirror²", async () => {
const elem = await helpers.waitForElement("title");
expect(elem).not.toBe(null);
expect(elem.textContent).toBe("MagicMirror²");
});
2017-01-30 12:29:32 -03:00
});