From fb578c66079c99eafa70cb11d8ca7d934abfa181 Mon Sep 17 00:00:00 2001 From: Gul Muhammad Date: Mon, 27 Jan 2025 14:11:18 +0500 Subject: [PATCH 1/2] fix:fix the first test by passing the correct events --- tests/Feature/Http/Api/ActivityControllerTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/Feature/Http/Api/ActivityControllerTest.php b/tests/Feature/Http/Api/ActivityControllerTest.php index 1e5b727..0372d3c 100644 --- a/tests/Feature/Http/Api/ActivityControllerTest.php +++ b/tests/Feature/Http/Api/ActivityControllerTest.php @@ -7,7 +7,7 @@ use App\Models\Project; use Illuminate\Support\Facades\Queue; -beforeEach()->only(); + it('can create an activity', function () { // Arrange... @@ -15,7 +15,12 @@ $project = Project::factory()->create()->fresh(); $events = [ - EventType::view('/about'), + [ + 'type' => EventType::View->value, // Use enum value + 'payload' => [ + 'url' => '/about', // Required for EventType::View + ], + ], ]; // Act... From 0934ca85bcd452e2c3d0b5551af0f83bcefa548a Mon Sep 17 00:00:00 2001 From: Gul Muhammad Date: Mon, 27 Jan 2025 14:20:53 +0500 Subject: [PATCH 2/2] removed extra comments --- tests/Feature/Http/Api/ActivityControllerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Feature/Http/Api/ActivityControllerTest.php b/tests/Feature/Http/Api/ActivityControllerTest.php index 0372d3c..104a5d9 100644 --- a/tests/Feature/Http/Api/ActivityControllerTest.php +++ b/tests/Feature/Http/Api/ActivityControllerTest.php @@ -16,7 +16,7 @@ $events = [ [ - 'type' => EventType::View->value, // Use enum value + 'type' => EventType::View->value, 'payload' => [ 'url' => '/about', // Required for EventType::View ],