diff --git a/tests/Feature/Services/NotificationEpochFallbackTest.php b/tests/Feature/Services/NotificationEpochFallbackTest.php deleted file mode 100644 index 8ccc41751..000000000 --- a/tests/Feature/Services/NotificationEpochFallbackTest.php +++ /dev/null @@ -1,62 +0,0 @@ - 1`, scanning the -| entire notifications table. -| -*/ - -beforeEach(function () { - Queue::fake(); - Cache::forget(NotificationService::EPOCH_CACHE_KEY.'6'); -}); - -it('returns a recent notification id on cache miss instead of 1', function () { - $old = Notification::create([ - 'profile_id' => 1, - 'actor_id' => 2, - 'action' => 'like', - 'created_at' => now()->subMonths(9), - ]); - - $recent = Notification::create([ - 'profile_id' => 1, - 'actor_id' => 2, - 'action' => 'like', - 'created_at' => now()->subMonth(), - ]); - - $epoch = NotificationService::getEpochId(); - - expect($epoch)->toBe($recent->id); - expect($epoch)->not->toBe(1); - expect($epoch)->toBeGreaterThan($old->id); - - Queue::assertPushed(NotificationEpochUpdatePipeline::class); -}); - -it('falls back to 1 when no recent notifications exist', function () { - Notification::create([ - 'profile_id' => 1, - 'actor_id' => 2, - 'action' => 'like', - 'created_at' => now()->subYear(), - ]); - - expect(NotificationService::getEpochId())->toBe(1); -});