Add test for old items

This commit is contained in:
rejas 2021-12-20 13:35:50 +01:00
parent 2107e7c427
commit f54c06fb94
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,28 @@
/* Magic Mirror Test config newsfeed module
*
* MIT Licensed.
*/
let config = {
timeFormat: 12,
modules: [
{
module: "newsfeed",
position: "bottom_bar",
config: {
feeds: [
{
title: "Rodrigo Ramirez Blog",
url: "http://localhost:8080/tests/configs/data/feed_test_rodrigoramirez.xml"
}
],
ignoreOldItems: true
}
}
]
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {
module.exports = config;
}

View File

@ -60,4 +60,17 @@ describe("Newsfeed module", function () {
expect(elem.textContent).toContain("Error in the Newsfeed module. Malformed url."); expect(elem.textContent).toContain("Error in the Newsfeed module. Malformed url.");
}); });
}); });
describe("Ignore items", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/newsfeed/ignore_items.js");
helpers.getDocument(done, 3000);
});
it("should show empty items info message", function () {
const elem = document.querySelector(".newsfeed .small");
expect(elem).not.toBe(null);
expect(elem.textContent).toContain("No news at the moment.");
});
});
}); });