From 7d1e823af8dfa72a9720dd156fdac5491aefe173 Mon Sep 17 00:00:00 2001 From: veeck Date: Tue, 4 Oct 2022 13:19:29 +0200 Subject: [PATCH] Add test for remoteFile option in compliments module --- CHANGELOG.md | 2 ++ tests/configs/data/compliments_test.json | 3 +++ .../modules/compliments/compliments_remote.js | 21 +++++++++++++++++++ tests/e2e/modules/compliments_spec.js | 11 ++++++++++ 4 files changed, 37 insertions(+) create mode 100644 tests/configs/data/compliments_test.json create mode 100644 tests/configs/modules/compliments/compliments_remote.js diff --git a/CHANGELOG.md b/CHANGELOG.md index aa421222d1..9082f6c892 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/tests/configs/data/compliments_test.json b/tests/configs/data/compliments_test.json new file mode 100644 index 0000000000..fa1d0b9c6c --- /dev/null +++ b/tests/configs/data/compliments_test.json @@ -0,0 +1,3 @@ +{ + "anytime": ["Remote compliment file works!"] +} diff --git a/tests/configs/modules/compliments/compliments_remote.js b/tests/configs/modules/compliments/compliments_remote.js new file mode 100644 index 0000000000..2b31f2ccb5 --- /dev/null +++ b/tests/configs/modules/compliments/compliments_remote.js @@ -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; +} diff --git a/tests/e2e/modules/compliments_spec.js b/tests/e2e/modules/compliments_spec.js index faf1d6c322..7479779730 100644 --- a/tests/e2e/modules/compliments_spec.js +++ b/tests/e2e/modules/compliments_spec.js @@ -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!"]); + }); + }); });