1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-09 10:22:51 +03:00

Added SVG support to the image gallery.

This commit is contained in:
Dan Brown
2022-05-22 11:52:42 +01:00
parent 49498cfaf9
commit c9aa1c979f
5 changed files with 36 additions and 9 deletions

View File

@@ -74,6 +74,23 @@ class ImageTest extends TestCase
$this->assertStringNotContainsString('thumbs-', $imgDetails['response']->thumbs->display);
}
public function test_svg_upload()
{
/** @var Page $page */
$page = Page::query()->first();
$admin = $this->getAdmin();
$this->actingAs($admin);
$imgDetails = $this->uploadGalleryImage($page, 'diagram.svg', 'image/svg+xml');
$this->assertFileExists(public_path($imgDetails['path']));
$this->assertTrue(
$imgDetails['response']->url === $imgDetails['response']->thumbs->gallery
&& $imgDetails['response']->url === $imgDetails['response']->thumbs->display,
);
$this->deleteImage($imgDetails['path']);
}
public function test_image_edit()
{
$editor = $this->getEditor();