From ce4906d13b9b680c4692dd298a9113b3fe5d7d17 Mon Sep 17 00:00:00 2001 From: Veeck Date: Tue, 4 Oct 2022 14:26:31 +0200 Subject: [PATCH] Add test in compliments module for remotFile option (#2932) nothing fancy here, just a simple test after @khassel's changes to the test setup :-) Co-authored-by: veeck --- 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 aa421222..9082f6c8 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 00000000..fa1d0b9c --- /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 00000000..2b31f2cc --- /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 faf1d6c3..74797797 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!"]); + }); + }); });