mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Add test for prohibited words
This commit is contained in:
parent
a70bb517e1
commit
639305ecc8
39
tests/configs/modules/newsfeed/prohibited_words.js
Normal file
39
tests/configs/modules/newsfeed/prohibited_words.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/* Magic Mirror Test config newsfeed module
|
||||||
|
*
|
||||||
|
* MIT Licensed.
|
||||||
|
*/
|
||||||
|
let config = {
|
||||||
|
port: 8080,
|
||||||
|
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
|
||||||
|
|
||||||
|
language: "en",
|
||||||
|
timeFormat: 12,
|
||||||
|
units: "metric",
|
||||||
|
electronOptions: {
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true,
|
||||||
|
enableRemoteModule: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
module: "newsfeed",
|
||||||
|
position: "bottom_bar",
|
||||||
|
config: {
|
||||||
|
feeds: [
|
||||||
|
{
|
||||||
|
title: "Rodrigo Ramirez Blog",
|
||||||
|
url: "http://localhost:8080/tests/configs/data/feed_test_rodrigoramirez.xml"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
prohibitedWords: ["QPanel"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||||
|
if (typeof module !== "undefined") {
|
||||||
|
module.exports = config;
|
||||||
|
}
|
@ -30,7 +30,21 @@ describe("Newsfeed module", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should show the newsfeed title", function () {
|
it("should show the newsfeed title", function () {
|
||||||
return app.client.waitUntilTextExists(".newsfeed .small", "Rodrigo Ramirez Blog", 10000);
|
return app.client.waitUntilTextExists(".newsfeed .newsfeed-source", "Rodrigo Ramirez Blog", 10000);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should show the newsfeed article", function () {
|
||||||
|
return app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "QPanel", 10000);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Custom configuration", function () {
|
||||||
|
before(function () {
|
||||||
|
process.env.MM_CONFIG_FILE = "tests/configs/modules/newsfeed/prohibited_words.js";
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should not show articles with prohibited words", function () {
|
||||||
|
return app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "Problema VirtualBox", 10000);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user