Mache Auswahl, Aufbau und Entwurf im Redaktionseditor bedienbar.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
6955830579
commit
053a361801
14 files changed
+1040
-155
No files matched your search
@@ -232,6 +232,60 @@ public function test_a_role_change_stays_on_the_selected_part_when_the_order_cha
|
||||
$this->assertSame($sheet->id, $versions[1]->members[1]->content_element_version_id);
|
||||
}
|
||||
|
||||
public function test_saving_a_draft_ten_times_creates_one_version_only_when_released(): void
|
||||
{
|
||||
$editor = $this->editor();
|
||||
$module = app(ContentService::class)->createComposition('Entwurf Modul', CompositionKind::Uebung);
|
||||
$component = Livewire::actingAs($editor, 'staff')
|
||||
->test(EditExercise::class, ['record' => $module->id])
|
||||
->set('newTextTitle', 'Hinweis')
|
||||
->set('newTextBody', 'Erst der Entwurf.')
|
||||
->call('addText');
|
||||
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
$component->set('learningGoal', 'Durchgang '.$i)->call('saveDraft');
|
||||
}
|
||||
|
||||
$module->refresh();
|
||||
$this->assertSame(0, $module->versions()->count());
|
||||
$this->assertSame('Durchgang 10', $module->working_draft['learning_goal']);
|
||||
|
||||
Livewire::actingAs($editor, 'staff')
|
||||
->test(EditExercise::class, ['record' => $module->id])
|
||||
->assertSet('learningGoal', 'Durchgang 10')
|
||||
->call('publishRevision')
|
||||
->assertSet('feedback', 'Die neue Fassung ist übernommen. Die bisherige Fassung bleibt erhalten.');
|
||||
|
||||
$module->refresh();
|
||||
$this->assertSame(1, $module->versions()->count());
|
||||
$this->assertSame('Durchgang 10', $module->versions()->first()->learning_goal);
|
||||
$this->assertNull($module->working_draft);
|
||||
|
||||
Livewire::actingAs($editor, 'staff')
|
||||
->test(EditExercise::class, ['record' => $module->id])
|
||||
->set('learningGoal', 'Nur Entwurf')
|
||||
->call('saveDraft');
|
||||
|
||||
$module->refresh();
|
||||
$this->assertSame(1, $module->versions()->count());
|
||||
$this->assertSame('Durchgang 10', $module->versions()->first()->fresh()->learning_goal);
|
||||
$this->assertSame('Nur Entwurf', $module->working_draft['learning_goal']);
|
||||
}
|
||||
|
||||
public function test_the_picker_finds_a_film_by_title(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
$content->publishElementVersion($content->createElement('film', 'film', 'Lara im Park'), 'Film');
|
||||
$module = $content->createComposition('Picker Modul', CompositionKind::Uebung);
|
||||
|
||||
Livewire::actingAs($this->editor(), 'staff')
|
||||
->test(EditExercise::class, ['record' => $module->id])
|
||||
->call('openPicker')
|
||||
->set('pickerQuery', 'Lara')
|
||||
->assertSee('Lara im Park')
|
||||
->assertSee('Neuen Text erstellen');
|
||||
}
|
||||
|
||||
public function test_guests_cannot_open_the_trainer_preview(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
|
||||
@@ -113,8 +113,8 @@ public function test_an_exercise_can_gain_and_drop_a_medium_without_losing_the_o
|
||||
$this->get(ExerciseResource::getUrl('edit', ['record' => $exercise->composition]))
|
||||
->assertOk()
|
||||
->assertSee('Merkblatt')
|
||||
->assertSee('Bestandteil suchen')
|
||||
->assertSee('Neue Fassung übernehmen');
|
||||
->assertSee('Bestandteil hinzufügen')
|
||||
->assertSee('Freigeben');
|
||||
|
||||
$this->get(CourseResource::getUrl('index'))->assertOk()->assertSee('Ein Programm aus Modulen');
|
||||
$this->assertStringContainsString('Ein Kurs ist keine Übung', CompositionKind::Kurs->explanation());
|
||||
|
||||
Reference in new issue
Block a user