mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
FIX: hide chat button in user card (#29887)
when the user isn't able to receive DMs (either because they've disabled it or because they're suspended for example). Internal ref - t/142198
This commit is contained in:
@ -39,13 +39,13 @@ module(
|
||||
.doesNotExist("it doesn’t show the chat button");
|
||||
});
|
||||
|
||||
test("when displayed user is suspended", async function (assert) {
|
||||
test("when displayed user has disabled PMs / DMs", async function (assert) {
|
||||
sinon
|
||||
.stub(this.owner.lookup("service:chat"), "userCanDirectMessage")
|
||||
.value(true);
|
||||
|
||||
this.user = new CoreFabricators(getOwner(this)).user({
|
||||
suspended_till: moment().add(1, "year").toDate(),
|
||||
can_send_private_message_to_user: false,
|
||||
});
|
||||
|
||||
await render(
|
||||
|
Reference in New Issue
Block a user