Implement creator studio and upload updates

This commit is contained in:
2026-04-04 10:12:02 +02:00
parent 1da7d3bf88
commit 0b216b7ecd
15107 changed files with 31206 additions and 626514 deletions

View File

@@ -0,0 +1,41 @@
<?php
use App\Models\Artwork;
use App\Models\User;
use App\Services\Artworks\ArtworkDraftService;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
it('allows duplicate artwork slugs when creating drafts', function () {
$user = User::factory()->create();
$drafts = app(ArtworkDraftService::class);
$first = $drafts->createDraft($user->id, 'Silent', null);
$second = $drafts->createDraft($user->id, 'Silent', null);
expect(Artwork::query()->findOrFail($first->artworkId)->slug)->toBe('silent')
->and(Artwork::query()->findOrFail($second->artworkId)->slug)->toBe('silent');
});
it('resolves public artwork pages by id even when slugs are duplicated', function () {
$first = Artwork::factory()->create([
'title' => 'Silent',
'slug' => 'silent',
'description' => 'First silent artwork.',
]);
$second = Artwork::factory()->create([
'title' => 'Silent',
'slug' => 'silent',
'description' => 'Second silent artwork.',
]);
$this->get(route('art.show', ['id' => $first->id, 'slug' => 'silent']))
->assertOk()
->assertSee('First silent artwork.', false);
$this->get(route('art.show', ['id' => $second->id, 'slug' => 'silent']))
->assertOk()
->assertSee('Second silent artwork.', false);
});