]> BookStack Code Mirror - bookstack/commitdiff
Fixed linting and failing test issues from dropzone work 4193/head
authorDan Brown <redacted>
Thu, 27 Apr 2023 12:31:03 +0000 (13:31 +0100)
committerDan Brown <redacted>
Thu, 27 Apr 2023 12:31:03 +0000 (13:31 +0100)
resources/js/components/attachments.js
tests/Uploads/ImageTest.php

index e185b3c5c7bd91bcd94003df59d1f7fb1bb732bd..f45b25e36d05f92d96d175e8b5207020bdcd4d14 100644 (file)
@@ -1,4 +1,4 @@
-import {onSelect, showLoading} from '../services/dom';
+import {showLoading} from '../services/dom';
 import {Component} from './component';
 
 export class Attachments extends Component {
index 53040ea086b00edc218f3cbb072c27d321dfbc87..97e36001c63a92a44d012b4c5a1f23e2d51d8833 100644 (file)
@@ -163,7 +163,8 @@ class ImageTest extends TestCase
 
         $file = $this->files->imageFromBase64File('bad-php.base64', $fileName);
         $upload = $this->withHeader('Content-Type', 'image/jpeg')->call('POST', '/images/gallery', ['uploaded_to' => $page->id], [], ['file' => $file], []);
-        $upload->assertStatus(302);
+        $upload->assertStatus(500);
+        $this->assertStringContainsString('The file must have a valid & supported image extension', $upload->json('message'));
 
         $this->assertFalse(file_exists(public_path($relPath)), 'Uploaded php file was uploaded but should have been stopped');
 
@@ -185,7 +186,8 @@ class ImageTest extends TestCase
 
         $file = $this->files->imageFromBase64File('bad-phtml.base64', $fileName);
         $upload = $this->withHeader('Content-Type', 'image/jpeg')->call('POST', '/images/gallery', ['uploaded_to' => $page->id], [], ['file' => $file], []);
-        $upload->assertStatus(302);
+        $upload->assertStatus(500);
+        $this->assertStringContainsString('The file must have a valid & supported image extension', $upload->json('message'));
 
         $this->assertFalse(file_exists(public_path($relPath)), 'Uploaded php file was uploaded but should have been stopped');
     }
Morty Proxy This is a proxified and sanitized view of the page, visit original site.