update
This commit is contained in:
29
tests/Feature/Dashboard/NotificationsPageTest.php
Normal file
29
tests/Feature/Dashboard/NotificationsPageTest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Models\Notification;
|
||||
use App\Models\User;
|
||||
|
||||
it('renders the dashboard notifications page for an authenticated user', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
Notification::query()->create([
|
||||
'user_id' => $user->id,
|
||||
'type' => 'comment',
|
||||
'data' => [
|
||||
'type' => 'comment',
|
||||
'message' => 'Someone commented on your artwork',
|
||||
'url' => '/dashboard/comments/received',
|
||||
],
|
||||
'read_at' => null,
|
||||
]);
|
||||
|
||||
$response = $this->actingAs($user)->get('/dashboard/notifications');
|
||||
|
||||
$response
|
||||
->assertOk()
|
||||
->assertSee('Notifications', false)
|
||||
->assertSee('Someone commented on your artwork', false)
|
||||
->assertSee('Unread', false);
|
||||
});
|
||||
Reference in New Issue
Block a user