X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/be4f3d62cd37c7b83eb86bbf5fffa00d20acf2ec..refs/pull/2023/head:/tests/Entity/ExportTest.php diff --git a/tests/Entity/ExportTest.php b/tests/Entity/ExportTest.php index 5fff84b8d..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('