2017-07-24 22:08:12 +02:00
|
|
|
const helpers = require("../global-setup");
|
2017-02-20 08:19:36 -03:00
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
const describe = global.describe;
|
|
|
|
const it = global.it;
|
|
|
|
const beforeEach = global.beforeEach;
|
|
|
|
const afterEach = global.afterEach;
|
2017-02-20 08:19:36 -03:00
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
describe("Newsfeed module", function () {
|
2017-07-24 22:08:12 +02:00
|
|
|
helpers.setupTimeout(this);
|
|
|
|
|
2021-03-16 13:47:48 +01:00
|
|
|
let app = null;
|
2017-07-24 22:08:12 +02:00
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
beforeEach(function () {
|
2017-07-24 22:08:12 +02:00
|
|
|
return helpers
|
|
|
|
.startApplication({
|
|
|
|
args: ["js/electron.js"]
|
|
|
|
})
|
2020-05-11 22:22:32 +02:00
|
|
|
.then(function (startedApp) {
|
2017-07-24 22:08:12 +02:00
|
|
|
app = startedApp;
|
|
|
|
});
|
2017-02-20 08:19:36 -03:00
|
|
|
});
|
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
afterEach(function () {
|
2017-07-24 22:08:12 +02:00
|
|
|
return helpers.stopApplication(app);
|
2017-02-20 08:19:36 -03:00
|
|
|
});
|
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
describe("Default configuration", function () {
|
|
|
|
before(function () {
|
2017-02-20 08:19:36 -03:00
|
|
|
process.env.MM_CONFIG_FILE = "tests/configs/modules/newsfeed/default.js";
|
|
|
|
});
|
|
|
|
|
2021-03-16 13:47:48 +01:00
|
|
|
it("should show the newsfeed title", function () {
|
2021-03-16 19:16:07 +01:00
|
|
|
return app.client.waitUntilTextExists(".newsfeed .small", "Rodrigo Ramirez Blog", 10000);
|
2017-02-20 08:19:36 -03:00
|
|
|
});
|
|
|
|
});
|
2021-03-16 13:47:48 +01:00
|
|
|
|
|
|
|
describe("Invalid configuration", function () {
|
|
|
|
before(function () {
|
|
|
|
process.env.MM_CONFIG_FILE = "tests/configs/modules/newsfeed/incorrect_url.js";
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should show invalid url warning", function () {
|
2021-03-16 19:16:07 +01:00
|
|
|
return app.client.waitUntilTextExists(".newsfeed .small", "Error in the Newsfeed module. Incorrect url:", 10000);
|
2021-03-16 13:47:48 +01:00
|
|
|
});
|
|
|
|
});
|
2017-02-20 08:19:36 -03:00
|
|
|
});
|