Skip to content

Commit f2aabd6

Browse files
mejo-backportbot[bot]
authored andcommitted
fix(notifciations): only notify users with access to board on mentions
fix(notifciations): only notify users with access to board on mentions Signed-off-by: Jonas <jonas@freesources.org> [skip ci]
1 parent ae8fbfc commit f2aabd6

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tests/unit/Notification/NotificationHelperTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,8 @@ public function testSendMention() {
489489
$comment->expects($this->once())
490490
->method('getMentions')
491491
->willReturn([
492-
['id' => 'user1'],
493-
['id' => 'user2']
492+
['id' => 'user1', 'type' => 'users'],
493+
['id' => 'user2', 'type' => 'users'],
494494
]);
495495
$card = new Card();
496496
$card->setId(123);
@@ -503,6 +503,13 @@ public function testSendMention() {
503503
->method('findBoardId')
504504
->with(123)
505505
->willReturn(1);
506+
$this->permissionService->expects($this->once())
507+
->method('findUsers')
508+
->with(1)
509+
->willReturn([
510+
'user1' => $this->createUserMock('user1'),
511+
'user2' => $this->createUserMock('user2'),
512+
]);
506513

507514
$notification1 = $this->createMock(INotification::class);
508515
$notification1->expects($this->once())->method('setApp')->with('deck')->willReturn($notification1);

0 commit comments

Comments
 (0)