FIX: Use prioritize_username_in_ux in post notices.

This commit is contained in:
Dan Ungureanu
2019-03-13 21:16:09 +02:00
parent 77931b70c3
commit 18ff790e79
2 changed files with 37 additions and 5 deletions

View File

@ -853,21 +853,43 @@ widgetTest("pm map", {
}
});
widgetTest("post notice", {
widgetTest("post notice - with username", {
template: '{{mount-widget widget="post" args=args}}',
beforeEach() {
this.siteSettings.prioritize_username_in_ux = true;
this.set("args", {
postNoticeType: "returning",
postNoticeTime: new Date("2010-01-01 12:00:00 UTC"),
username: "codinghorror"
username: "codinghorror",
name: "Jeff"
});
},
test(assert) {
assert.equal(
find(".post-notice")
find(".post-notice.returning-user")
.text()
.trim(),
I18n.t("post.notice.return", { user: "codinghorror", time: "Jan '10" })
);
}
});
widgetTest("post notice - with name", {
template: '{{mount-widget widget="post" args=args}}',
beforeEach() {
this.siteSettings.prioritize_username_in_ux = false;
this.set("args", {
postNoticeType: "first",
username: "codinghorror",
name: "Jeff"
});
},
test(assert) {
assert.equal(
find(".post-notice.new-user")
.text()
.trim(),
I18n.t("post.notice.first", { user: "Jeff", time: "Jan '10" })
);
}
});