Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

newsfeed_spec.js 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. const helpers = require("../global-setup");
  2. describe("Newsfeed module", function () {
  3. afterAll(function () {
  4. helpers.stopApplication();
  5. });
  6. describe("Default configuration", function () {
  7. beforeAll(function (done) {
  8. helpers.startApplication("tests/configs/modules/newsfeed/default.js");
  9. helpers.getDocument(done, 3000);
  10. });
  11. it("should show the newsfeed title", function () {
  12. const elem = document.querySelector(".newsfeed .newsfeed-source");
  13. expect(elem).not.toBe(null);
  14. expect(elem.textContent).toContain("Rodrigo Ramirez Blog");
  15. });
  16. it("should show the newsfeed article", function () {
  17. const elem = document.querySelector(".newsfeed .newsfeed-title");
  18. expect(elem).not.toBe(null);
  19. expect(elem.textContent).toContain("QPanel");
  20. });
  21. it("should NOT show the newsfeed description", () => {
  22. const elem = document.querySelector(".newsfeed .newsfeed-desc");
  23. expect(elem).toBe(null);
  24. });
  25. });
  26. describe("Custom configuration", function () {
  27. beforeAll(function (done) {
  28. helpers.startApplication("tests/configs/modules/newsfeed/prohibited_words.js");
  29. helpers.getDocument(done, 3000);
  30. });
  31. it("should not show articles with prohibited words", function () {
  32. const elem = document.querySelector(".newsfeed .newsfeed-title");
  33. expect(elem).not.toBe(null);
  34. expect(elem.textContent).toContain("Problema VirtualBox");
  35. });
  36. it("should show the newsfeed description", () => {
  37. const elem = document.querySelector(".newsfeed .newsfeed-desc");
  38. expect(elem).not.toBe(null);
  39. expect(elem.textContent.length).not.toBe(0);
  40. });
  41. });
  42. describe("Invalid configuration", function () {
  43. beforeAll(function (done) {
  44. helpers.startApplication("tests/configs/modules/newsfeed/incorrect_url.js");
  45. helpers.getDocument(done, 3000);
  46. });
  47. it("should show malformed url warning", function () {
  48. const elem = document.querySelector(".newsfeed .small");
  49. expect(elem).not.toBe(null);
  50. expect(elem.textContent).toContain("Error in the Newsfeed module. Malformed url.");
  51. });
  52. });
  53. });