X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/43830a372fc51a8793199d04a34c3f4ebdfccc7b..refs/pull/3387/head:/tests/Uploads/ImageTest.php diff --git a/tests/Uploads/ImageTest.php b/tests/Uploads/ImageTest.php index 296e4d187..01754d2de 100644 --- a/tests/Uploads/ImageTest.php +++ b/tests/Uploads/ImageTest.php @@ -61,6 +61,19 @@ class ImageTest extends TestCase $this->assertEquals($originalFileSize, $displayFileSize, 'Display thumbnail generation should not increase image size'); } + public function test_image_display_thumbnail_generation_for_apng_images_uses_original_file() + { + $page = Page::query()->first(); + $admin = $this->getAdmin(); + $this->actingAs($admin); + + $imgDetails = $this->uploadGalleryImage($page, 'animated.png'); + $this->deleteImage($imgDetails['path']); + + $this->assertStringContainsString('thumbs-', $imgDetails['response']->thumbs->gallery); + $this->assertStringNotContainsString('thumbs-', $imgDetails['response']->thumbs->display); + } + public function test_image_edit() { $editor = $this->getEditor(); @@ -301,8 +314,8 @@ class ImageTest extends TestCase $galleryFile = $this->getTestImage('my-system-test-upload.png'); $expectedPath = public_path('uploads/images/system/' . date('Y-m') . '/my-system-test-upload.png'); - $upload = $this->call('POST', '/settings', [], [], ['app_logo' => $galleryFile], []); - $upload->assertRedirect('/settings'); + $upload = $this->call('POST', '/settings/customization', [], [], ['app_logo' => $galleryFile], []); + $upload->assertRedirect('/settings/customization'); $this->assertTrue(file_exists($expectedPath), 'Uploaded image not found at path: ' . $expectedPath);