use BookStack\Entities\Models\Chapter;
use BookStack\Entities\Models\Page;
use Tests\TestCase;
class PageEditorTest extends TestCase
{
use BookStack\Entities\Models\Chapter;
use BookStack\Entities\Models\Page;
use Tests\TestCase;
class PageEditorTest extends TestCase
{
public function test_empty_markdown_still_saves_without_error()
{
$this->setSettings(['app-editor' => 'markdown']);
public function test_empty_markdown_still_saves_without_error()
{
$this->setSettings(['app-editor' => 'markdown']);
$this->asEditor()->get($book->getUrl('/create-page'));
$draft = Page::query()->where('book_id', '=', $book->id)
$this->asEditor()->get($book->getUrl('/create-page'));
$draft = Page::query()->where('book_id', '=', $book->id)
$this->asEditor()->get($book->getUrl('/create-page'));
/** @var Chapter $chapter */
$chapter = $book->chapters()->firstOrFail();
$this->asEditor()->get($book->getUrl('/create-page'));
/** @var Chapter $chapter */
$chapter = $book->chapters()->firstOrFail();
$page->html = '<h2>A Header</h2><p>Some <strong>bold</strong> content.</p>';
$page->editor = 'wysiwyg';
$page->save();
$page->html = '<h2>A Header</h2><p>Some <strong>bold</strong> content.</p>';
$page->editor = 'wysiwyg';
$page->save();