Fix first comment in mobile view with french locale

Fixes #7438. The regression has possibly been introduced by #7207.

closes #7441
This commit is contained in:
Steffen van Bergerem 2017-05-03 11:54:35 +02:00 committed by Benjamin Neff
parent e7cfaa7e42
commit fc28d6af35
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
3 changed files with 15 additions and 2 deletions

View file

@ -4,6 +4,7 @@
## Bug fixes
* Make photo upload button hover text translatable [#7429](https://github.com/diaspora/diaspora/pull/7429)
* Fix first comment in mobile view with french locale [#7441](https://github.com/diaspora/diaspora/pull/7441)
## Features

View file

@ -201,7 +201,7 @@
increaseReactionCount: function(bottomBar) {
var toggleReactionsLink = bottomBar.find(".show-comments").first();
var count = toggleReactionsLink.text().match(/.*(\d+).*/);
count = parseInt(count, 10);
count = parseInt(count, 10) || 0;
var text = Diaspora.I18n.t("stream.comments", {count: count + 1});
// No previous comment

View file

@ -144,7 +144,7 @@ describe("Diaspora.Mobile.Comments", function(){
expect(this.toggleReactionsLink.text().trim()).toBe("6 comments");
});
it("Creates the reaction link when no reactions", function(){
it("Creates the reaction link when there are no reactions", function() {
var parent = this.toggleReactionsLink.parent();
var postGuid = this.bottomBar.parents(".stream-element").data("guid");
this.toggleReactionsLink.remove();
@ -155,6 +155,18 @@ describe("Diaspora.Mobile.Comments", function(){
expect(this.toggleReactionsLink.text().trim()).toBe("1 comment");
expect(this.toggleReactionsLink.attr("href")).toBe("/posts/" + postGuid + "/comments.mobile");
});
it("Creates the reaction link when there are no reactions (french locale)", function() {
var parent = this.toggleReactionsLink.parent();
var postGuid = this.bottomBar.parents(".stream-element").data("guid");
this.toggleReactionsLink.remove();
parent.prepend($("<span/>", {"class": "show-comments"}).text("Aucun commentaire"));
Diaspora.Mobile.Comments.increaseReactionCount(this.bottomBar);
this.toggleReactionsLink = this.bottomBar.find(".show-comments").first();
expect(this.toggleReactionsLink.text().trim()).toBe("1 comment");
expect(this.toggleReactionsLink.attr("href")).toBe("/posts/" + postGuid + "/comments.mobile");
});
});
describe("bottomBarLazy", function(){