]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/ExportTest.php
Update settings.php
[bookstack] / tests / Entity / ExportTest.php
index 683f23674d66ed6997c947c2d2fe409b67994f86..e3a74f64d1d2c306df662071b369beadfd9bfbac 100644 (file)
@@ -3,6 +3,7 @@
 
 use BookStack\Entities\Chapter;
 use BookStack\Entities\Page;
+use BookStack\Uploads\HttpFetcher;
 
 class ExportTest extends TestCase
 {
@@ -148,4 +149,17 @@ class ExportTest extends TestCase
         $resp->assertDontSee($page->updated_at->diffForHumans());
     }
 
+    public function test_page_export_sets_right_data_type_for_svg_embeds()
+    {
+        $page = Page::first();
+        $page->html = '<img src="http://example.com/image.svg">';
+        $page->save();
+
+        $this->asEditor();
+        $this->mockHttpFetch('<svg></svg>');
+        $resp = $this->get($page->getUrl('/export/html'));
+        $resp->assertStatus(200);
+        $resp->assertSee('<img src="data:image/svg+xml;base64');
+    }
+
 }
\ No newline at end of file