1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Pages: Fixed unused changelog on first page publish

Included test to cover.
For #5056
This commit is contained in:
Dan Brown
2024-06-09 17:18:23 +01:00
parent c77e8730d6
commit a8ce199e0d
2 changed files with 28 additions and 1 deletions

View File

@ -86,6 +86,32 @@ class PageTest extends TestCase
$resp->assertSee('# a title');
}
public function test_page_creation_allows_summary_to_be_set()
{
$book = $this->entities->book();
$this->asEditor()->get($book->getUrl('/create-page'));
$draft = Page::query()->where('book_id', '=', $book->id)
->where('draft', '=', true)->first();
$details = [
'html' => '<h1>a title</h1>',
'name' => 'My page with summary',
'summary' => 'Here is my changelog message for a new page!',
];
$resp = $this->post($book->getUrl("/draft/{$draft->id}"), $details);
$resp->assertRedirect();
$this->assertDatabaseHas('page_revisions', [
'page_id' => $draft->id,
'summary' => 'Here is my changelog message for a new page!',
]);
$draft->refresh();
$resp = $this->get($draft->getUrl('/revisions'));
$resp->assertSee('Here is my changelog message for a new page!');
}
public function test_page_delete()
{
$page = $this->entities->page();