Skip to content

Commit

Permalink
Add test for remoteFile option in compliments module
Browse files Browse the repository at this point in the history
  • Loading branch information
veeck committed Oct 4, 2022
1 parent 8212d30 commit 7d1e823
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ _This release is scheduled to be released on 2023-01-01._

### Added

- Added test for remoteFile option in compliments module

### Removed

### Updated
Expand Down
3 changes: 3 additions & 0 deletions tests/configs/data/compliments_test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"anytime": ["Remote compliment file works!"]
}
21 changes: 21 additions & 0 deletions tests/configs/modules/compliments/compliments_remote.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* MagicMirror² Test config compliments with remote file
*
* By Rejas
* MIT Licensed.
*/
let config = {
modules: [
{
module: "compliments",
position: "middle_center",
config: {
remoteFile: "http://localhost:8080/tests/configs/data/compliments_test.json"
}
}
]
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {
module.exports = config;
}
11 changes: 11 additions & 0 deletions tests/e2e/modules/compliments_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,15 @@ describe("Compliments module", () => {
});
});
});

describe("remoteFile option", () => {
beforeAll(async () => {
helpers.startApplication("tests/configs/modules/compliments/compliments_remote.js");
await helpers.getDocument();
});

it("should show compliments from a remote file", async () => {
await doTest(["Remote compliment file works!"]);
});
});
});

0 comments on commit 7d1e823

Please sign in to comment.