-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
384 additions
and
444 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,27 @@ | ||
const helpers = require("./global-setup"); | ||
|
||
describe("App environment", () => { | ||
beforeAll((done) => { | ||
beforeAll(async () => { | ||
helpers.startApplication("tests/configs/default.js"); | ||
helpers.getDocument(done); | ||
await helpers.getDocument(); | ||
}); | ||
afterAll(async () => { | ||
await helpers.stopApplication(); | ||
}); | ||
|
||
it("get request from http://localhost:8080 should return 200", (done) => { | ||
helpers.fetch(done, "http://localhost:8080").then((res) => { | ||
expect(res.status).toBe(200); | ||
}); | ||
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", (done) => { | ||
helpers.fetch(done, "http://localhost:8080/nothing").then((res) => { | ||
expect(res.status).toBe(404); | ||
}); | ||
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²", (done) => { | ||
helpers.waitForElement(done, "title").then((elem) => { | ||
expect(elem).not.toBe(null); | ||
expect(elem.textContent).toBe("MagicMirror²"); | ||
}); | ||
it("should show the title MagicMirror²", async () => { | ||
const elem = await helpers.waitForElement("title"); | ||
expect(elem).not.toBe(null); | ||
expect(elem.textContent).toBe("MagicMirror²"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
const helpers = require("../global-setup"); | ||
|
||
describe("Alert module", () => { | ||
beforeAll((done) => { | ||
beforeAll(async () => { | ||
helpers.startApplication("tests/configs/modules/alert/default.js"); | ||
helpers.getDocument(done); | ||
await helpers.getDocument(); | ||
}); | ||
afterAll(async () => { | ||
await helpers.stopApplication(); | ||
}); | ||
|
||
it("should show the welcome message", (done) => { | ||
helpers.waitForElement(done, ".ns-box .ns-box-inner .light.bright.small").then((elem) => { | ||
expect(elem).not.toBe(null); | ||
expect(elem.textContent).toContain("Welcome, start was successful!"); | ||
}); | ||
it("should show the welcome message", async () => { | ||
const elem = await helpers.waitForElement(".ns-box .ns-box-inner .light.bright.small"); | ||
expect(elem).not.toBe(null); | ||
expect(elem.textContent).toContain("Welcome, start was successful!"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.