Zeige Entwürfe in der Medienauswahl eines Moduls.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b71ee8023b
commit
1168c04228
3 files changed
+38
-5
No files matched your search
@@ -467,6 +467,39 @@ public function test_the_picker_groups_versions_and_adopts_the_chosen_one(): voi
|
||||
$this->assertSame('element:'.$first->id, $module->working_draft['members'][0]['target']);
|
||||
}
|
||||
|
||||
public function test_the_picker_includes_draft_media(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
$ready = $content->publishElementVersion($content->createElement('text', 'text', 'Fertiger Hinweis'), 'Text');
|
||||
$onlyDraft = $content->draftElementVersion($content->createElement('film', 'film', 'Felix beim Onkel'), 'Szene');
|
||||
$revised = $content->createElement('text', 'text', 'Hinweis mit Entwurf');
|
||||
$content->publishElementVersion($revised, 'Alt');
|
||||
$newerDraft = $content->draftElementVersion($revised, 'Neu');
|
||||
$module = $content->createComposition('Auswahl', CompositionKind::Uebung);
|
||||
|
||||
$component = Livewire::actingAs($this->editor(), 'staff')
|
||||
->test(EditExercise::class, ['record' => $module->id])
|
||||
->call('openPicker');
|
||||
|
||||
$byTitle = [];
|
||||
|
||||
foreach ($component->instance()->pickerResult()['items'] as $item) {
|
||||
$byTitle[$item['title']] = $item['target'];
|
||||
}
|
||||
|
||||
$this->assertSame('element:'.$ready->id, $byTitle['Fertiger Hinweis']);
|
||||
$this->assertSame('element:'.$onlyDraft->id, $byTitle['Felix beim Onkel']);
|
||||
$this->assertSame('element:'.$newerDraft->id, $byTitle['Hinweis mit Entwurf']);
|
||||
|
||||
$component
|
||||
->set('pickerSelected', 'element:'.$onlyDraft->id)
|
||||
->assertSee('Felix beim Onkel')
|
||||
->call('addPart', 'element:'.$onlyDraft->id);
|
||||
|
||||
$this->assertSame('element:'.$onlyDraft->id, $module->fresh()->working_draft['members'][0]['target']);
|
||||
$this->assertSame(ContentVersionStatus::Entwurf, $onlyDraft->fresh()->status);
|
||||
}
|
||||
|
||||
public function test_the_part_dialog_saves_a_role_without_a_new_version(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
|
||||
Reference in new issue
Block a user