Skip to content

Commit 6d3b393

Browse files
committed
wip
1 parent 6acada9 commit 6d3b393

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

app/Listeners/NotifyUsersMentionedInThread.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
final class NotifyUsersMentionedInThread
1111
{
1212
public function handle(ThreadWasCreated $event): void
13-
{
13+
{dd('test');
1414
$event->thread->mentionedUsers()->each(function ($user) use ($event) {
1515
if (! $user->isNotificationAllowed(MentionNotification::class)) {
1616
return;

tests/Feature/ReplyTest.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,20 @@
201201
'replyable_type' => Thread::TABLE,
202202
]);
203203

204-
$notification = DatabaseNotification::first();
205-
$this->assertSame($user->id, (int) $notification->notifiable_id);
206-
$this->assertSame('users', $notification->notifiable_type);
207-
$this->assertSame('mention', $notification->data['type']);
208-
$this->assertSame('The first thread', $notification->data['replyable_subject']);
204+
$tested = false;
205+
206+
foreach (DatabaseNotification::all() as $notification) {
207+
if ($notification->type === MentionNotification::class) {
208+
$this->assertSame($user->id, (int) $notification->notifiable_id);
209+
$this->assertSame('users', $notification->notifiable_type);
210+
$this->assertSame('mention', $notification->data['type']);
211+
$this->assertSame('The first thread', $notification->data['replyable_subject']);
212+
213+
$tested = true;
214+
}
215+
}
216+
217+
$this->assertTrue($tested);
209218
})->only();
210219

211220
test('users are not notified when mentioned in an edited reply', function () {

0 commit comments

Comments
 (0)