-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2103 from rejas/issue_1985
Fix "undefined" in weather modules header.
- Loading branch information
Showing
9 changed files
with
107 additions
and
16 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
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,5 +1,5 @@ | ||
# Weather Module | ||
|
||
This module aims to be the replacement for the current `currentweather` and `weatherforcast` modules. The module will be configurable to be used as a current weather view, or to show the forecast. This way the module can be used twice to fullfil both purposes. | ||
This module aims to be the replacement for the current `currentweather` and `weatherforcast` modules. The module will be configurable to be used as a current weather view, or to show the forecast. This way the module can be used twice to fulfill both purposes. | ||
|
||
For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/weather.html). |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* Magic Mirror Test config for display setters module using the helloworld module | ||
* | ||
* MIT Licensed. | ||
*/ | ||
var config = { | ||
port: 8080, | ||
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], | ||
|
||
language: "en", | ||
timeFormat: 24, | ||
units: "metric", | ||
electronOptions: { | ||
fullscreen: false, | ||
width: 800, | ||
height: 600, | ||
webPreferences: { | ||
nodeIntegration: true | ||
} | ||
}, | ||
|
||
modules: [ | ||
{ | ||
module: "helloworld", | ||
position: "top_bar", | ||
header: "test_header", | ||
config: { | ||
text: "Test Display Header" | ||
} | ||
}, | ||
{ | ||
module: "helloworld", | ||
position: "bottom_bar", | ||
config: { | ||
text: "Test Hide Header" | ||
} | ||
} | ||
] | ||
}; | ||
/*************** DO NOT EDIT THE LINE BELOW ***************/ | ||
if (typeof module !== "undefined") { | ||
module.exports = config; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const helpers = require("./global-setup"); | ||
|
||
const describe = global.describe; | ||
const it = global.it; | ||
|
||
describe("Display of modules", function () { | ||
helpers.setupTimeout(this); | ||
|
||
var app = null; | ||
|
||
beforeEach(function () { | ||
return helpers | ||
.startApplication({ | ||
args: ["js/electron.js"] | ||
}) | ||
.then(function (startedApp) { | ||
app = startedApp; | ||
}); | ||
}); | ||
|
||
afterEach(function () { | ||
return helpers.stopApplication(app); | ||
}); | ||
|
||
describe("Using helloworld", function () { | ||
before(function () { | ||
// Set config sample for use in test | ||
process.env.MM_CONFIG_FILE = "tests/configs/modules/display.js"; | ||
}); | ||
|
||
it("should show the test header", async () => { | ||
await app.client.waitForExist("#module_0_helloworld", 10000); | ||
return app.client.element("#module_0_helloworld .module-header").isVisible().should.eventually.equal(true).getText("#module_0_helloworld .module-header").should.eventually.equal("TEST_HEADER"); | ||
}); | ||
|
||
it("should show no header if no header text is specified", async () => { | ||
await app.client.waitForExist("#module_1_helloworld", 10000); | ||
return app.client.element("#module_1_helloworld .module-header").isVisible().should.eventually.equal(false); | ||
}); | ||
}); | ||
}); |