X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/822fea430393d417f31cd9aebbcb5734aea79264..b005acdd6caa446bf6d91604586ac227050c7680:/tests/Api/PagesApiTest.php diff --git a/tests/Api/PagesApiTest.php b/tests/Api/PagesApiTest.php index d52c6b513..eca606234 100644 --- a/tests/Api/PagesApiTest.php +++ b/tests/Api/PagesApiTest.php @@ -219,6 +219,27 @@ class PagesApiTest extends TestCase $resp->assertStatus(403); } + public function test_update_endpoint_does_not_wipe_content_if_no_html_or_md_provided() + { + $this->actingAsApiEditor(); + $page = Page::visible()->first(); + $originalContent = $page->html; + $details = [ + 'name' => 'My updated API page', + 'tags' => [ + [ + 'name' => 'freshtag', + 'value' => 'freshtagval', + ], + ], + ]; + + $this->putJson($this->baseEndpoint . "/{$page->id}", $details); + $page->refresh(); + + $this->assertEquals($originalContent, $page->html); + } + public function test_delete_endpoint() { $this->actingAsApiEditor();