X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/919660678bec2b94eaa84ac60d0313f5ef07dfb7..refs/pull/2023/head:/tests/Entity/ExportTest.php
diff --git a/tests/Entity/ExportTest.php b/tests/Entity/ExportTest.php
index 51090650c..5a94adac9 100644
--- a/tests/Entity/ExportTest.php
+++ b/tests/Entity/ExportTest.php
@@ -1,8 +1,11 @@
-assertHeader('Content-Disposition', 'attachment; filename="' . $book->slug . '.html"');
}
+ public function test_book_html_export_shows_chapter_descriptions()
+ {
+ $chapterDesc = 'My custom test chapter description ' . Str::random(12);
+ $chapter = Chapter::query()->first();
+ $chapter->description = $chapterDesc;
+ $chapter->save();
+
+ $book = $chapter->book;
+ $this->asEditor();
+
+ $resp = $this->get($book->getUrl('/export/html'));
+ $resp->assertSee($chapterDesc);
+ }
+
public function test_chapter_text_export()
{
$chapter = Chapter::first();
@@ -123,4 +140,28 @@ class ExportTest extends TestCase
$resp->assertSee($customHeadContent);
}
+ public function test_page_html_export_use_absolute_dates()
+ {
+ $page = Page::first();
+
+ $resp = $this->asEditor()->get($page->getUrl('/export/html'));
+ $resp->assertSee($page->created_at->toDayDateTimeString());
+ $resp->assertDontSee($page->created_at->diffForHumans());
+ $resp->assertSee($page->updated_at->toDayDateTimeString());
+ $resp->assertDontSee($page->updated_at->diffForHumans());
+ }
+
+ public function test_page_export_sets_right_data_type_for_svg_embeds()
+ {
+ $page = Page::first();
+ $page->html = '
';
+ $page->save();
+
+ $this->asEditor();
+ $this->mockHttpFetch('');
+ $resp = $this->get($page->getUrl('/export/html'));
+ $resp->assertStatus(200);
+ $resp->assertSee(';
+ }
+
}
\ No newline at end of file
)