Baue den Redaktionsmanager auf gemeinsame Bausteine um.
CI Feature / test (push) Successful in 56s

Medium, Modul, Programm und Lizenzartikel nutzen denselben Objektkopf,
dieselben Register (Texte, Präsentationsmedien, Einordnung) und denselben
visuellen Picker. Präsentationsmedien, Abweichungen und Texte bilden einen
Arbeitsstand, den nur „Redaktion speichern“ schreibt; Austausch behält die
Position, Sortierung bleibt in der Rolle. Der Wechsel zur Redaktion und zurück
erhält offene Eingaben des Ausgangseditors.

Entfernt versteckte Mitspeicherungen: Der Didaktikdialog schreibt keine
Redaktionstexte mehr, die Website-Freigabe keine offenen Quellenzeilen,
Entwurf verwerfen setzt keine offenen Redaktionseingaben zurück. Tests, die
alte Orte oder CSS-Zeichenketten prüften, sind auf die neue Bedienung
umgestellt; neue Tests decken Arbeitsstand, Austausch, Abbrechen und
Rückweg ab. Datenmodell, Fassungen und Rechte bleiben unverändert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-19 22:46:43 +01:00
1 parent 41658d98dd
commit e1fd59491c
44 files changed
+3917 -2173

No files matched your search

+6 -2
View File
@@ -100,8 +100,12 @@ public function test_catalog_pages_show_contents_packages_and_resolved_rights():
->assertOk()
->assertSee('Hinweis für die Prüfung.')
->assertSee('Fassung 1')
->assertSee('Übung: Übung Alltag')
->assertSee('Lizenzartikel demo-merkblatt')
->assertSee('Neue Fassung anlegen');
$this->actingAs($editor, 'staff')
->get(ContentElementResource::getUrl('view', ['record' => $sheet->element]).'?bereich=verwendung')
->assertOk()
->assertSee('Übung: Übung Alltag')
->assertSee('Lizenzartikel demo-merkblatt');
}
}
+23 -18
View File
@@ -90,17 +90,18 @@ public function test_a_film_keeps_its_version_when_editorial_text_and_presentati
app(IdentityDimension::class)->assign($film, $audience);
Livewire::test(ViewContentElement::class, ['record' => $film->getKey()])
->set('bereich', 'praesentation')
->set('presentationRole', 'titelbild')
->set('presentationPick', 'element:'.$cover->versions()->first()->id)
->call('assignPickedPresentation')
->set('presentationRole', 'trailer')
->set('presentationPick', 'element:'.$trailer->versions()->first()->id)
->call('openRedaktion', 'medien')
->call('openPresentationPicker', 'titelbild')
->call('assignFromPicker', 'element:'.$cover->versions()->first()->id)
->call('openPresentationPicker', 'trailer')
->set('bindToVersion', true)
->call('assignPickedPresentation')
->call('assignFromPicker', 'element:'.$trailer->versions()->first()->id)
->assertSee('Titel Park')
->assertSee('Trailer Park')
->assertSee('Standard-Titelbild')
->assertSee('Neu zugeordnet')
->assertSee('Änderungen nicht gespeichert')
->call('saveRedaktion')
->assertSee('Alle Änderungen gespeichert')
->call('releaseAssigned', $trailer->id)
->assertSee('Für die Website freigegeben');
@@ -161,7 +162,8 @@ public function test_a_module_description_does_not_version_the_composition_or_cr
->call('openPresentationPicker')
->set('pickerQuery', 'Modulbild ohne')
->assertSee('Modulbild ohne Fassung')
->call('assignFromPicker', 'medium:'.$cover->id);
->call('assignFromPicker', 'medium:'.$cover->id)
->call('saveRedaktion');
$module->refresh();
$version->refresh();
@@ -229,9 +231,10 @@ public function test_a_program_keeps_its_own_cover_trailer_and_gallery_order():
$this->actingAs($actor, 'staff');
Livewire::test(EditCourse::class, ['record' => $program->getKey()])
->call('openRedaktion', 'medien')
->assertSee('Programmcover')
->assertSee('Galerie zwei')
->assertSee('Standard-Titelbild');
->assertSee('Titelbild');
}
public function test_a_license_article_overrides_only_its_own_presentation(): void
@@ -260,10 +263,12 @@ public function test_a_license_article_overrides_only_its_own_presentation(): vo
$this->assertSame('Lara im Park', $profile->value('display_title'));
Livewire::test(ViewLicenseArticle::class, ['record' => $article->getKey()])
->call('openRedaktion')
->assertSee('Übernommen aus Lara im Park')
->set('summary', 'Eigene Artikelbeschreibung')
->call('saveLicenseEditorial')
->assertSee('Stand, Preis und Rechte bleiben unverändert.')
->assertSee('Übernommen von Lara im Park')
->assertSee('Übernommen aus Lara im Park')
->assertSee('Eigene Angabe');
$article->refresh();
@@ -284,12 +289,13 @@ public function test_a_license_article_overrides_only_its_own_presentation(): vo
$cover = $this->pictureWithoutVersion('Artikelbild ohne Fassung');
Livewire::test(ViewLicenseArticle::class, ['record' => $article->getKey()])
->assertSet('summary', 'Eigene Artikelbeschreibung')
->call('openRedaktion')
->set('descriptionText', 'Nur dieser Artikel')
->call('openPresentationPicker', 'titelbild')
->set('pickerQuery', 'Artikelbild ohne')
->assertSee('Artikelbild ohne Fassung')
->call('assignFromPicker', 'medium:'.$cover->id)
->call('saveLicenseEditorial')
->set('presentationQuery', 'Artikelbild ohne')
->set('presentationRole', 'titelbild')
->set('presentationPick', 'medium:'.$cover->id)
->call('assignPickedPresentation')
->assertSee('Artikelbild ohne Fassung');
$overridden = app(EditorialProfileReader::class)->read($article->fresh(), 'artikel');
@@ -345,7 +351,7 @@ public function test_content_elements_do_not_offer_the_pillar_dimension_a_second
$this->actingAs($this->editor(), 'staff');
$html = Livewire::test(ViewContentElement::class, ['record' => $film->getKey()])
->set('bereich', 'beschreibung')
->call('openRedaktion', 'einordnung')
->set('dimensionIds', [$kinder->id])
->call('saveEditorial')
->html();
@@ -366,8 +372,7 @@ public function test_content_elements_do_not_offer_the_pillar_dimension_a_second
'target' => $film->versions()->first(),
]]);
Livewire::test(EditExercise::class, ['record' => $module->getKey()])
->call('openModule')
->set('moduleTab', 'einordnung')
->call('openRedaktion', 'einordnung')
->assertSee('Nähe als Dimension')
->assertDontSee('Fachliche Säulen');
}
+12 -13
View File
@@ -346,8 +346,8 @@ public function test_catalog_cards_show_text_status_and_a_single_film_suggestion
->test(EditExercise::class, ['record' => $withFilm->composition_id])
->assertSee('In Mitgliederbibliothek anzeigen')
->assertSee('Vorschlag aus dem Film Lara im Park')
->assertSee('Katalogvorschau')
->assertSee('Modul bearbeiten')
->assertSee('Katalogbild')
->assertSee('Didaktik und Katalogbild bearbeiten')
->assertDontSee('Anzeige speichern')
->assertDontSee('Zur Anzeige freigeben');
}
@@ -397,7 +397,7 @@ public function test_a_chosen_picture_and_description_do_not_create_a_version():
$this->get('/medien/'.$composition->thumbnail_path)->assertNotFound();
}
public function test_the_module_dialog_saves_text_without_a_new_version(): void
public function test_texts_save_in_the_redaktion_and_the_dialog_keeps_didactics_without_a_new_version(): void
{
$content = app(ContentService::class);
$sheet = $content->publishElementVersion($content->createElement('text', 'text', 'Blatt'), 'Hinweis');
@@ -411,21 +411,20 @@ public function test_the_module_dialog_saves_text_without_a_new_version(): void
->test(EditExercise::class, ['record' => $version->composition_id])
->assertDontSee('Anzeige speichern')
->call('openModule')
->assertSee('Beschreibung')
->assertSee('Didaktik')
->assertSee('Einordnung')
->assertSee('Titelbild')
->set('description', 'Weg damit')
->assertSee('Katalogbild')
->assertSee('Name, Texte und Einordnung bearbeitest du in der Redaktion.')
->set('learningGoal', 'Weg damit')
->call('closeModule')
->assertSet('description', '');
->assertSet('learningGoal', '');
Livewire::actingAs($editor, 'staff')
->test(EditExercise::class, ['record' => $version->composition_id])
->call('openRedaktion')
->set('description', 'Ausführlicher Dialogtext')
->set('summary', 'Kurzer Dialogtext')
->call('saveModule')
->assertSet('moduleOpen', false)
->assertSee('Es entsteht keine neue Fassung');
->call('saveRedaktion')
->assertSee('Aufbau, Lernziel, Zeit und Fassungen bleiben unverändert.');
$composition = $version->composition->fresh();
$this->assertSame(1, $composition->versions()->count());
@@ -658,8 +657,8 @@ public function test_a_file_can_be_created_inside_the_module(): void
$component = Livewire::actingAs($editor, 'staff')
->test(EditExercise::class, ['record' => $module->id])
->assertSee('Medium anlegen')
->set('pickerOpen', true)
->assertSee('Material auswählen')
->call('openPicker')
->assertSee('Bestandteil auswählen')
->mountAction('createMedium')
->assertSet('pickerOpen', false)
->assertMountedActionModalSee('Vorschaubild')
+7 -3
View File
@@ -238,13 +238,15 @@ public function test_a_description_does_not_create_a_version_and_an_older_versio
Livewire::test(ViewContentElement::class, ['record' => $element->getKey()])
->set('bereich', 'inhalt')
->assertSee('Fassung 1')
->assertSee('Fassung 2')
->assertSee('<video', false)
->assertSee(route('content.file', $second), false)
->set('bereich', 'fassungen')
->assertSee('Fassung 1')
->assertSee('Fassung 2')
->callAction('deactivate', ['reason' => 'Veraltet'], ['version' => $first->id])
->assertHasNoFormErrors()
->assertSee('deaktiviert');
->assertSee('Deaktiviert');
$first->refresh();
@@ -289,7 +291,9 @@ public function test_usage_and_license_notes_stay_on_the_medium_and_in_the_list(
Livewire::actingAs($editor, 'staff')
->test(ViewContentElement::class, ['record' => $element->getKey()])
->call('openRedaktion')
->assertSee('Hinweise für den Einsatz')
->assertSee('Vor dem Film den Abstand ansprechen.')
->assertSee('Interner Lizenzvermerk');
$this->get('/')->assertDontSee('Nur intern: Archivmaterial der Produktion.');
@@ -486,7 +490,7 @@ public function test_a_draft_medium_can_be_released_from_its_editor(): void
Livewire::actingAs($editor, 'staff')
->test(ViewContentElement::class, ['record' => $version->content_element_id])
->set('bereich', 'inhalt')
->set('bereich', 'fassungen')
->assertSee('noch nicht freigegeben')
->mountAction('releaseVersion', ['version' => $version->id])
->callMountedAction();
+3 -2
View File
@@ -35,13 +35,14 @@ public function test_editorial_text_is_saved_without_a_new_version_and_previewed
$this->actingAs($editor, 'staff');
Livewire::test(ViewContentElement::class, ['record' => $element->getKey()])
->set('bereich', 'beschreibung')
->call('openRedaktion')
->set('displayTitle', 'Lara im Park, neu')
->set('summary', 'Ein kurzer Teaser für die Karte')
->set('descriptionText', 'Ausführliche Beschreibung nur in der Verwaltung')
->call('saveEditorial')
->assertSee('Gespeichert. Es gibt keine neue Fassung.')
->assertSee('Ein kurzer Teaser für die Karte')
->call('openAusgabe')
->assertSee('lf-pc');
$element->refresh();
@@ -85,7 +86,7 @@ public function test_the_picker_keeps_drafts_for_modules_and_limits_images_and_w
->set('pickerQuery', 'Offener');
$titles = array_column($modulePicker->instance()->pickerResult()['items'], 'title');
$this->assertContains('Offener Entwurf', $titles);
$modulePicker->assertSee('Entwürfe bleiben sichtbar');
$modulePicker->assertSee('Bestandteil auswählen')->assertSee('Offener Entwurf');
$page = Livewire::test(ViewContentElement::class, ['record' => $film->element->getKey()])
->set('pickerContext', 'bild');
+6 -5
View File
@@ -75,18 +75,19 @@ public function test_a_versionless_image_and_teaser_can_be_assigned_released_and
$this->assertNotContains('medium:'.$teaser->id, array_column($didactic['items'], 'target'));
Livewire::test(EditCourse::class, ['record' => $program->getKey()])
->call('openPresentationPicker')
->call('openRedaktion', 'medien')
->call('openPresentationPicker', 'titelbild')
->set('pickerQuery', 'Pruefbild ohne')
->set('presentationRole', 'titelbild')
->assertSee('Pruefbild ohne Fassung')
->call('assignFromPicker', 'medium:'.$image->id)
->call('openPresentationPicker')
->call('openPresentationPicker', 'trailer')
->set('pickerQuery', 'Teaser ohne')
->set('presentationRole', 'trailer')
->set('bindToVersion', false)
->call('assignFromPicker', 'medium:'.$teaser->id)
->call('saveRedaktion')
->assertSee('Pruefbild ohne Fassung')
->assertSee('Teaser ohne Fassung')
->assertSee('Eigenständiges Medium, ohne Bindung an eine Fassung.');
->assertDontSee('Gebunden an Fassung');
$this->assertSame(0, $image->fresh()->versions()->count());
$this->assertSame(0, $teaser->fresh()->versions()->count());
+234 -23
View File
@@ -3,7 +3,11 @@
namespace Tests\Feature;
use App\Domain\Catalog\CompositionKind;
use App\Domain\Catalog\ContentElement;
use App\Domain\Catalog\ContentService;
use App\Domain\Catalog\EditorialTextVariant;
use App\Domain\Catalog\PresentationAssignment;
use App\Domain\Catalog\PresentationMedia;
use App\Filament\Resources\ContentElements\Pages\ViewContentElement;
use App\Filament\Resources\Exercises\Pages\EditExercise;
use App\Models\User;
@@ -42,21 +46,23 @@ public function test_redaktion_return_keeps_open_composition_inputs_and_saves_on
->assertSet('redaktionOpen', true)
->assertSet('partOpen', false)
->assertSee('Redaktion speichern')
->assertSee('Ausgabe prüfen')
->assertSee('grid-template-areas: "griff daumen text aktionen"', false)
->assertDontSee('grid-column: 2 / -1', false)
->assertSee('Zurück zum Aufbau')
->assertSee('Präsentationsmedien')
->assertDontSee('In Mitgliederbibliothek anzeigen')
->assertDontSee('Vorschau für Trainer')
->assertSet('roleDraft', 'Einstieg')
->assertSet('learningGoal', 'Grenze erkennen')
->set('teaser', 'Kurzer Teaser im Manager')
->assertSee('Änderungen nicht gespeichert')
->call('closeRedaktion')
->assertSet('redaktionOpen', false)
->assertSee('Die Redaktion hat ungespeicherte Änderungen.')
->assertSet('teaser', 'Kurzer Teaser im Manager')
->assertSet('roleDraft', 'Einstieg')
->assertSet('learningGoal', 'Grenze erkennen')
->call('saveRedaktion')
->assertSee('Aufbau, Lernziel, Zeit und Fassungen bleiben unverändert.');
->assertSee('Aufbau, Lernziel, Zeit und Fassungen bleiben unverändert.')
->assertSet('learningGoal', 'Grenze erkennen');
$composition = $version->composition->fresh();
$this->assertSame('Kurzer Teaser im Manager', $composition->teaser);
@@ -65,6 +71,33 @@ public function test_redaktion_return_keeps_open_composition_inputs_and_saves_on
$this->assertSame('Unterlage', $composition->versions()->first()->members()->first()->role);
}
public function test_didactic_dialog_and_draft_discard_do_not_touch_open_redaktion_inputs(): void
{
$content = app(ContentService::class);
$sheet = $content->publishElementVersion($content->createElement('text', 'text', 'Blatt'), 'Hinweis');
$version = $content->publishComposition(
$content->createComposition('Verdeckt', CompositionKind::Uebung),
[['role' => 'Unterlage', 'target' => $sheet]],
);
$page = Livewire::actingAs($this->editor(), 'staff')
->test(EditExercise::class, ['record' => $version->composition_id])
->call('openRedaktion')
->set('teaser', 'Noch nicht gespeichert')
->call('closeRedaktion')
->call('openModule')
->set('durationMinutes', '20')
->call('saveModule')
->assertSet('teaser', 'Noch nicht gespeichert');
$this->assertNull($version->composition->fresh()->teaser);
$page->call('discardDraft')
->assertSet('teaser', 'Noch nicht gespeichert');
$this->assertNull($version->composition->fresh()->teaser);
}
public function test_media_redaktion_return_keeps_the_open_version_text(): void
{
$content = app(ContentService::class);
@@ -76,6 +109,7 @@ public function test_media_redaktion_return_keeps_the_open_version_text(): void
->test(ViewContentElement::class, ['record' => $film->getKey()])
->set('bereich', 'inhalt')
->set('bodyDraft', 'Offener Lehrtext')
->set('thumbnailAlt', 'Offener Alternativtext')
->call('openRedaktion')
->assertSee('Zurück zur Medienbearbeitung')
->set('teaser', 'Neuer Teaser')
@@ -83,38 +117,215 @@ public function test_media_redaktion_return_keeps_the_open_version_text(): void
->assertSet('redaktionOpen', false)
->assertSet('bereich', 'inhalt')
->assertSet('bodyDraft', 'Offener Lehrtext')
->assertSet('teaser', 'Neuer Teaser');
->assertSet('thumbnailAlt', 'Offener Alternativtext')
->assertSet('teaser', 'Neuer Teaser')
->call('openRedaktion')
->assertSet('teaser', 'Neuer Teaser')
->call('saveRedaktion')
->call('closeRedaktion')
->assertSet('thumbnailAlt', 'Offener Alternativtext');
$this->assertNull($film->fresh()->teaser);
$film->refresh();
$this->assertSame('Neuer Teaser', $film->teaser);
$this->assertNull($film->thumbnail_alt);
}
public function test_picker_mark_survives_search_and_cancel_does_not_apply_it(): void
public function test_website_release_does_not_save_open_redaktion_inputs(): void
{
$content = app(ContentService::class);
$module = $content->createComposition('Picker', CompositionKind::Uebung);
$image = $content->createElement('bild', 'bild', 'Szenenbild');
$editor = $this->editor();
Livewire::actingAs($editor, 'staff')
->test(EditExercise::class, ['record' => $module->id])
->call('openPicker')
->set('pickerSelected', 'element:9')
->set('pickerQuery', 'nichts-davon')
->assertSet('pickerSelected', 'element:9')
->call('closePicker')
->assertSet('pickerOpen', false)
->assertSet('pickerSelected', '');
->test(ViewContentElement::class, ['record' => $image->getKey()])
->call('openRedaktion')
->set('websiteCredit', 'Offene Quellenzeile')
->set('teaser', 'Offener Teaser')
->call('closeRedaktion')
->set('bereich', 'website')
->call('releaseForWebsite')
->assertSet('websiteCredit', 'Offene Quellenzeile')
->assertSet('teaser', 'Offener Teaser');
$image->refresh();
$this->assertNull($image->website_credit);
$this->assertNull($image->teaser);
}
public function test_presentation_changes_are_staged_until_redaktion_is_saved(): void
{
$content = app(ContentService::class);
$film = $content->createElement('film', 'film', 'Lara im Park');
$content->publishElementVersion($film, 'Filmfassung');
$first = $this->picture('Galerie eins');
$second = $this->picture('Galerie zwei');
$page = Livewire::actingAs($this->editor(), 'staff')
->test(ViewContentElement::class, ['record' => $film->getKey()])
->call('openRedaktion', 'medien')
->call('openPresentationPicker', 'galerie')
->call('markPicker', 'medium:'.$first->id, true)
->call('markPicker', 'medium:'.$second->id, true)
->set('pickerQuery', 'etwas ganz anderes')
->assertSet('pickerMarked', ['medium:'.$first->id => 'Galerie eins', 'medium:'.$second->id => 'Galerie zwei'])
->assertSee('2 Medien übernehmen')
->call('confirmPicker')
->assertSet('pickerOpen', false)
->assertSee('Neu zugeordnet')
->assertSee('Änderungen nicht gespeichert');
$this->assertSame(0, PresentationAssignment::query()->where('subject_id', $film->id)->count());
$page->call('saveRedaktion')->assertSee('Alle Änderungen gespeichert');
$this->assertSame([$first->id, $second->id], $this->order($film, 'galerie'));
}
public function test_cancelling_the_picker_keeps_the_existing_assignment(): void
{
$content = app(ContentService::class);
$film = $content->createElement('film', 'film', 'Lara im Park');
$content->publishElementVersion($film, 'Filmfassung');
$cover = $this->picture('Titel alt');
$other = $this->picture('Titel neu');
app(PresentationMedia::class)->assign($film, 'titelbild', $cover->id, null);
$key = 'a'.PresentationAssignment::query()->value('id');
Livewire::actingAs($this->editor(), 'staff')
->test(ViewContentElement::class, ['record' => $film->getKey()])
->call('openRedaktion', 'medien')
->call('beginExchange', $key)
->call('markPicker', 'medium:'.$other->id, true)
->call('closePicker')
->assertSee('Die vorhandene Zuordnung bleibt unverändert.')
->assertSee('Alle Änderungen gespeichert');
$this->assertSame([$cover->id], $this->order($film, 'titelbild'));
}
public function test_exchange_keeps_the_position_and_reordering_stays_within_its_role(): void
{
$content = app(ContentService::class);
$film = $content->createElement('film', 'film', 'Lara im Park');
$content->publishElementVersion($film, 'Filmfassung');
$one = $this->picture('Bild eins');
$two = $this->picture('Bild zwei');
$three = $this->picture('Bild drei');
$replacement = $this->picture('Bild neu');
$cover = $this->picture('Titel');
$media = app(PresentationMedia::class);
$media->assign($film, 'titelbild', $cover->id, null);
foreach ([$one, $two, $three] as $image) {
$media->assign($film, 'galerie', $image->id, null);
}
$keyOf = fn (ContentElement $image): string => 'a'.PresentationAssignment::query()->where('content_element_id', $image->id)->value('id');
Livewire::actingAs($this->editor(), 'staff')
->test(ViewContentElement::class, ['record' => $film->getKey()])
->call('openRedaktion', 'medien')
->call('beginExchange', $keyOf($two))
->call('markPicker', 'medium:'.$replacement->id, true)
->assertSee('Austauschen')
->call('confirmPicker')
->assertSee('ersetzt die bisherige Zuordnung an derselben Stelle')
->call('movePresentation', $keyOf($three), -1)
->call('movePresentation', $keyOf($one), -1)
->call('saveRedaktion');
$this->assertSame([$one->id, $three->id, $replacement->id], $this->order($film, 'galerie'));
$this->assertSame([$cover->id], $this->order($film, 'titelbild'));
$this->assertNotNull($two->fresh(), 'Entfernen einer Zuordnung löscht das Medium nicht.');
}
public function test_removing_an_assignment_keeps_the_medium_and_its_website_release(): void
{
$content = app(ContentService::class);
$film = $content->createElement('film', 'film', 'Lara im Park');
$content->publishElementVersion($film, 'Filmfassung');
$image = $this->picture('Freigegebenes Bild');
$image->website_released_at = now();
$image->save();
app(PresentationMedia::class)->assign($film, 'titelbild', $image->id, null);
$key = 'a'.PresentationAssignment::query()->value('id');
Livewire::actingAs($this->editor(), 'staff')
->test(ViewContentElement::class, ['record' => $film->getKey()])
->call('openRedaktion', 'medien')
->call('removePresentation', $key)
->assertSee('Änderungen nicht gespeichert')
->call('saveRedaktion');
$this->assertSame(0, PresentationAssignment::query()->where('subject_id', $film->id)->count());
$this->assertNotNull($image->fresh());
$this->assertNotNull($image->fresh()->website_released_at);
}
public function test_discarding_the_redaktion_restores_saved_values_only(): void
{
$content = app(ContentService::class);
$film = $content->createElement('film', 'film', 'Lara im Park');
$film->teaser = 'Gespeichert';
$film->save();
$content->publishElementVersion($film, 'Filmfassung');
Livewire::actingAs($this->editor(), 'staff')
->test(ViewContentElement::class, ['record' => $film->getKey()])
->set('bodyDraft', 'Offener Lehrtext')
->call('openRedaktion')
->set('teaser', 'Verworfen')
->set('variantBody', 'Nur für die Kachel')
->call('saveVariant')
->call('discardRedaktion')
->assertSet('teaser', 'Gespeichert')
->assertSet('bodyDraft', 'Offener Lehrtext')
->assertSee('Alle Änderungen gespeichert');
$this->assertSame(0, EditorialTextVariant::query()->count());
}
public function test_a_missing_working_title_is_shown_at_the_field_and_nothing_is_saved(): void
{
$content = app(ContentService::class);
$film = $content->createElement('film', 'film', 'Lara im Park');
$content->publishElementVersion($film, 'Filmfassung');
Livewire::actingAs($editor, 'staff')
Livewire::actingAs($this->editor(), 'staff')
->test(ViewContentElement::class, ['record' => $film->getKey()])
->set('presentationPick', 'medium:4')
->set('presentationQuery', 'andere-suche')
->assertSet('presentationPick', 'medium:4')
->call('cancelPresentationPick')
->assertSet('presentationPick', '')
->assertSee('Die vorhandene Zuordnung bleibt unverändert.');
->call('openRedaktion', 'medien')
->set('workingTitle', '')
->set('teaser', 'Bleibt offen')
->call('saveRedaktion')
->assertSet('redaktionTab', 'texte')
->assertSet('redaktionFehlerFeld', 'workingTitle')
->assertSee('Der Arbeitstitel fehlt.')
->assertSet('teaser', 'Bleibt offen');
$this->assertNull($film->fresh()->teaser);
$this->assertSame('Lara im Park', $film->fresh()->working_title);
}
private function picture(string $title): ContentElement
{
$image = app(ContentService::class)->createElement('bild', 'bild', $title);
$image->thumbnail_path = 'vorschau/'.md5($title).'.jpg';
$image->save();
return $image;
}
/**
* @return list<int>
*/
private function order(ContentElement $subject, string $role): array
{
return PresentationAssignment::query()
->where('subject_type', $subject->getMorphClass())
->where('subject_id', $subject->id)
->whereHas('role', fn ($query) => $query->where('slug', $role))
->orderBy('position')
->pluck('content_element_id')
->map(fn ($id): int => (int) $id)
->all();
}
private function editor(): User
+4
View File
@@ -50,8 +50,12 @@ public function test_a_preview_image_can_be_released_without_a_license_or_a_new_
$this->actingAs($editor, 'staff');
Livewire::test(ViewContentElement::class, ['record' => $element->getKey()])
->call('openRedaktion')
->set('websiteCredit', 'Foto: Lara und Felix, eigene Aufnahme')
->set('websiteAlt', 'Lara sitzt auf einer Parkbank')
->call('saveRedaktion')
->call('closeRedaktion')
->set('bereich', 'website')
->call('releaseForWebsite')
->assertSee('Für die Website freigegeben');