minor fixes

This commit is contained in:
2026-04-09 08:50:36 +02:00
parent 23d363a50c
commit a2457f4e49
75 changed files with 3848 additions and 387 deletions

View File

@@ -1,5 +1,6 @@
<?php
use App\Models\Artwork;
use App\Services\ArtworkService;
use Illuminate\Pagination\LengthAwarePaginator;
@@ -40,3 +41,25 @@ it('home page still renders with rising section data', function () {
$this->get('/')
->assertStatus(200);
});
it('uses the low-signal fallback ordering when rising search results have no momentum', function () {
$olderArtwork = Artwork::withoutEvents(fn () => Artwork::factory()->create([
'title' => 'Older Fallback Artwork',
'is_public' => true,
'is_approved' => true,
'published_at' => now()->subDays(4),
'created_at' => now()->subDays(4),
]));
$newerArtwork = Artwork::withoutEvents(fn () => Artwork::factory()->create([
'title' => 'Newer Fallback Artwork',
'is_public' => true,
'is_approved' => true,
'published_at' => now()->subHour(),
'created_at' => now()->subHour(),
]));
$this->get('/discover/rising')
->assertStatus(200)
->assertSeeInOrder(['Newer Fallback Artwork', 'Older Fallback Artwork'], false);
});