Prüfe Altseiten im echten Altformat und zeige Speicherfehler am Abschnitt.
CI Feature / test (push) Successful in 29s
Deploy Test / test (push) Successful in 26s
Deploy Test / deploy (push) Successful in 31s

- Der Altseiten-Test schreibt die Seederdaten vor dem Vergleich im flachen
  Format zurück, wie sie auf Test und Produktion liegen (die Migration
  speichert sie inzwischen über die Registry); zusätzlich ein Rundlauf
  Editor -> Speichern -> Veröffentlichen.
- Fehler, die erst die Registry erkennt, erscheinen als Meldung mit
  Abschnittsnummer und Art (Felder liegen im Dialog).
- Seite anlegen übernimmt die gewählten Säulen (wurden bisher verworfen).
- Nach dem Speichern wird der Editor neu befüllt, damit duplizierte
  Abschnitte ihre Kennung behalten.
- Entwicklerdokumentation der Registry inkl. Rollback-Hinweis.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-17 18:01:55 +01:00
1 parent 9d936bfa4a
commit 2dc479a8a4
6 files changed
+274 -8

No files matched your search

+49
View File
@@ -2,6 +2,7 @@
namespace Tests\Feature;
use App\Domain\Catalog\PillarService;
use App\Domain\Cms\NavigationItem;
use App\Domain\Cms\Page;
use App\Filament\Resources\NavigationItems\Pages\ManageNavigationItems;
@@ -12,6 +13,7 @@
use Filament\Actions\Testing\TestAction;
use Filament\Facades\Filament;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Livewire\Livewire;
use Tests\Support\BuildsCatalog;
@@ -126,6 +128,53 @@ public function test_unsafe_link_is_reported_at_the_section_and_nothing_is_saved
$this->assertSame($revisions, $page->revisions()->count());
}
public function test_errors_found_only_by_the_registry_are_announced_with_the_section(): void
{
Storage::fake('media_public');
Storage::fake('cms_incoming');
Storage::disk('media_public')->put('cms/bild.jpg', 'bild');
$page = Page::query()->where('path', '/')->firstOrFail();
$revisions = $page->revisions()->count();
$component = Livewire::actingAs($this->editor(), 'staff')->test(EditPage::class, ['record' => $page->id]);
$state = $component->get('data.blocks');
$state[(string) Str::uuid()] = ['type' => 'hero', 'data' => ['variant' => 'standard', 'data' => ['heading' => 'Mit Bild'], 'refs' => ['image' => 'cms/bild.jpg']]];
$component->set('data.blocks', $state)
->call('save')
->assertNotified('Nicht gespeichert');
$this->assertSame($revisions, $page->revisions()->count());
}
public function test_new_page_keeps_the_selected_pillars(): void
{
$pillar = app(PillarService::class)->create('Grenzen');
Livewire::actingAs($this->editor(), 'staff')
->test(CreatePage::class)
->fillForm(['path' => '/grenzen-thema', 'pillars' => [$pillar->id], 'blocks' => []])
->call('create')
->assertHasNoFormErrors();
$this->assertSame([$pillar->id], Page::query()->where('path', '/grenzen-thema')->firstOrFail()->pillars()->pluck('pillars.id')->all());
}
public function test_duplicated_section_keeps_its_new_id_across_saves(): void
{
$page = Page::query()->where('path', '/')->firstOrFail();
$component = Livewire::actingAs($this->editor(), 'staff')->test(EditPage::class, ['record' => $page->id]);
$state = $component->get('data.blocks');
$state[(string) Str::uuid()] = $state[array_key_first($state)];
$component->set('data.blocks', $state)->call('save')->assertHasNoFormErrors();
$first = array_column($page->fresh()->latestRevision->blocks, 'id');
$component->call('save')->assertHasNoFormErrors();
$second = array_column($page->fresh()->latestRevision->blocks, 'id');
$this->assertCount(5, array_unique($first));
$this->assertSame($first, $second);
}
public function test_invalid_or_taken_paths_are_shown_at_the_path_field(): void
{
Livewire::actingAs($this->editor(), 'staff')