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:
Régis Hanol
2024-11-22 09:05:58 +01:00
committed by GitHub
parent 5bf5d13356
commit d71016522e
3 changed files with 8 additions and 3 deletions

View File

@ -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(