Merge pull request #2518 from oemel09/hide-newsfeed-description

This commit is contained in:
Michael Teeuw 2021-04-10 14:56:49 +02:00 committed by GitHub
commit 13fcb55df6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 8 deletions

View File

@ -21,6 +21,7 @@ _This release is scheduled to be released on 2021-04-01._
- Fix calendar start function logging inconsistency.
- Fix updatenotification start function logging inconsistency.
- Checks and applies the showDescription setting for the newsfeed module again
## [2.15.0] - 2021-04-01

View File

@ -13,13 +13,15 @@
<div class="newsfeed-title bright medium light{{ ' no-wrap' if not config.wrapTitle }}">
{{ title }}
</div>
<div class="newsfeed-desc small light{{ ' no-wrap' if not config.wrapDescription }}">
{% if config.truncDescription %}
{{ description | truncate(config.lengthDescription) }}
{% else %}
{{ description }}
{% endif %}
</div>
{% if config.showDescription %}
<div class="newsfeed-desc small light{{ ' no-wrap' if not config.wrapDescription }}">
{% if config.truncDescription %}
{{ description | truncate(config.lengthDescription) }}
{% else %}
{{ description }}
{% endif %}
</div>
{% endif %}
</div>
{% elseif error %}
<div class="small dimmed">

View File

@ -27,7 +27,8 @@ let config = {
url: "http://localhost:8080/tests/configs/data/feed_test_rodrigoramirez.xml"
}
],
prohibitedWords: ["QPanel"]
prohibitedWords: ["QPanel"],
showDescription: true
}
}
]

View File

@ -1,4 +1,5 @@
const helpers = require("../global-setup");
const expect = require("chai").expect;
const describe = global.describe;
const it = global.it;
@ -36,6 +37,12 @@ describe("Newsfeed module", function () {
it("should show the newsfeed article", function () {
return app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "QPanel", 10000);
});
it("should NOT show the newsfeed description", async () => {
await app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "QPanel", 10000);
const events = await app.client.$$(".newsfeed .newsfeed-desc");
return expect(events.length).equals(0);
});
});
describe("Custom configuration", function () {
@ -46,6 +53,12 @@ describe("Newsfeed module", function () {
it("should not show articles with prohibited words", function () {
return app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "Problema VirtualBox", 10000);
});
it("should show the newsfeed description", async () => {
await app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "Problema VirtualBox", 10000);
const events = await app.client.$$(".newsfeed .newsfeed-desc");
return expect(events.length).equals(1);
});
});
describe("Invalid configuration", function () {