Unverified Commit fc28d6af authored by Steffen van Bergerem's avatar Steffen van Bergerem Committed by Benjamin Neff

Fix first comment in mobile view with french locale

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

closes #7441
parent e7cfaa7e
......@@ -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
......
......@@ -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
......
......@@ -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(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment