optimizations

This commit is contained in:
2026-03-28 19:15:39 +01:00
parent 0b25d9570a
commit cab4fbd83e
509 changed files with 1016804 additions and 1605 deletions

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
use App\Models\Artwork;
use App\Models\User;
use function Pest\Laravel\actingAs;
use function Pest\Laravel\postJson;
it('creates upload drafts as private artworks', function (): void {
$user = User::factory()->create();
actingAs($user);
$response = postJson('/api/artworks', [
'title' => 'Upload draft test',
'description' => '<p>Draft body</p>',
'is_mature' => false,
]);
$response->assertCreated()
->assertJsonPath('status', 'draft');
$artworkId = (int) $response->json('artwork_id');
$artwork = Artwork::query()->findOrFail($artworkId);
expect($artwork->visibility)->toBe(Artwork::VISIBILITY_PRIVATE)
->and($artwork->is_public)->toBeFalse()
->and($artwork->artwork_status)->toBe('draft')
->and($artwork->published_at)->toBeNull();
});