chore: commit current workspace changes

This commit is contained in:
2026-05-02 09:37:14 +02:00
parent 79235133f0
commit caf1464aa5
121 changed files with 485218 additions and 181663 deletions

View File

@@ -9,6 +9,7 @@ use App\Models\User;
use App\Services\Posts\PostFeedService;
use App\Services\Posts\PostShareService;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cache;
use Illuminate\Validation\ValidationException;
// ── SQLite polyfill + helpers ──────────────────────────────────────────────────
@@ -154,6 +155,25 @@ test('GET /api/posts/following returns posts from followed users only', function
expect($ids)->each->toBe($followed->id);
});
test('GET /api/feed/trending returns formatted posts', function () {
Cache::forget('feed:trending');
$author = User::factory()->create();
$post = Post::factory()->create([
'user_id' => $author->id,
'visibility' => Post::VISIBILITY_PUBLIC,
'status' => Post::STATUS_PUBLISHED,
'body' => 'Trending post body',
]);
$response = $this->getJson('/api/feed/trending');
$response->assertOk()
->assertJsonPath('data.0.id', $post->id)
->assertJsonPath('data.0.author.id', $author->id)
->assertJsonPath('meta.current_page', 1);
});
// ── Reactions ─────────────────────────────────────────────────────────────────
test('POST /api/posts/{id}/reactions adds reaction and increments counter', function () {