Leite Programmvorschauen ueber die Queue ab und seede den Testbestand nicht erneut
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
295f784703
commit
57802dfe48
4 files changed
+51
-10
No files matched your search
@@ -156,6 +156,50 @@ public function test_an_exercise_can_gain_and_drop_a_medium_without_losing_the_o
|
||||
$this->assertSame(3, $exercise->composition->versions()->count());
|
||||
}
|
||||
|
||||
public function test_a_composition_preview_is_derived_without_a_new_version(): void
|
||||
{
|
||||
Storage::fake('cms_incoming');
|
||||
Storage::fake('media_derived');
|
||||
$image = imagecreatetruecolor(8, 8);
|
||||
ob_start();
|
||||
imagepng($image);
|
||||
$png = ob_get_clean();
|
||||
imagedestroy($image);
|
||||
Storage::disk('cms_incoming')->put('vorschau/karte.png', $png);
|
||||
|
||||
$content = app(ContentService::class);
|
||||
$sheet = $content->publishElementVersion(
|
||||
$content->createElement('text', 'text', 'Blatt'),
|
||||
'Text',
|
||||
);
|
||||
$exercise = $content->publishComposition(
|
||||
$content->createComposition('Alltag üben'),
|
||||
[['role' => 'Blatt', 'target' => $sheet]],
|
||||
);
|
||||
$editor = User::factory()->redakteur()->create();
|
||||
$editor->saveAppAuthenticationSecret('JBSWY3DPEHPK3PXP');
|
||||
$this->actingAs($editor, 'staff');
|
||||
|
||||
Livewire::test(EditExercise::class, ['record' => $exercise->composition_id])
|
||||
->fillForm([
|
||||
'designation' => 'Alltag üben',
|
||||
'kind' => 'uebung',
|
||||
'members' => [
|
||||
['role' => 'Blatt', 'target' => 'element:'.$sheet->id],
|
||||
],
|
||||
'thumbnail_upload' => ['vorschau/karte.png'],
|
||||
])
|
||||
->call('save')
|
||||
->assertHasNoFormErrors();
|
||||
|
||||
$composition = $exercise->composition->fresh();
|
||||
|
||||
$this->assertSame(1, $composition->versions()->count());
|
||||
$this->assertSame('vorschau/komposition-'.$composition->id.'.jpg', $composition->thumbnail_path);
|
||||
Storage::disk('media_derived')->assertExists($composition->thumbnail_path);
|
||||
$this->assertNull($composition->thumbnail_error);
|
||||
}
|
||||
|
||||
public function test_a_catalog_keeper_cannot_edit_media(): void
|
||||
{
|
||||
$element = app(ContentService::class)->createElement('text', 'text', 'Hinweis');
|
||||
|
||||
Reference in new issue
Block a user