diff --git a/public/uploads/.gitignore b/public/uploads/.gitignore old mode 100644 new mode 100755 diff --git a/resources/assets/sass/_header.scss b/resources/assets/sass/_header.scss index 9384642..8fed6ae 100644 --- a/resources/assets/sass/_header.scss +++ b/resources/assets/sass/_header.scss @@ -161,7 +161,7 @@ form.search-box { } } -.faded > span.faded-text { +.faded span.faded-text { display: inline-block; padding: $-s; opacity: 0.5; @@ -189,6 +189,9 @@ form.search-box { padding-left: 0; } } + &.text-center { + text-align: center; + } } .setting-nav { diff --git a/resources/views/pages/form.blade.php b/resources/views/pages/form.blade.php index b8194cd..a5beaba 100644 --- a/resources/views/pages/form.blade.php +++ b/resources/views/pages/form.blade.php @@ -14,14 +14,11 @@
-
- - -
+
-
- +
+
diff --git a/tests/EntitySearchTest.php b/tests/Entity/EntitySearchTest.php similarity index 100% rename from tests/EntitySearchTest.php rename to tests/Entity/EntitySearchTest.php diff --git a/tests/EntityTest.php b/tests/Entity/EntityTest.php similarity index 100% rename from tests/EntityTest.php rename to tests/Entity/EntityTest.php diff --git a/tests/Entity/PageUpdateDraftTest.php b/tests/Entity/PageUpdateDraftTest.php new file mode 100644 index 0000000..d321974 --- /dev/null +++ b/tests/Entity/PageUpdateDraftTest.php @@ -0,0 +1,62 @@ +page = \BookStack\Page::first(); + $this->pageRepo = app('\BookStack\Repos\PageRepo'); + } + + public function test_draft_content_shows_if_available() + { + $addedContent = '

test message content

'; + $this->asAdmin()->visit($this->page->getUrl() . '/edit') + ->dontSeeInField('html', $addedContent); + + $newContent = $this->page->html . $addedContent; + $this->pageRepo->saveUpdateDraft($this->page, ['html' => $newContent]); + $this->asAdmin()->visit($this->page->getUrl() . '/edit') + ->seeInField('html', $newContent); + } + + public function test_draft_not_visible_by_others() + { + $addedContent = '

test message content

'; + $this->asAdmin()->visit($this->page->getUrl() . '/edit') + ->dontSeeInField('html', $addedContent); + + $newContent = $this->page->html . $addedContent; + $newUser = $this->getNewUser(); + $this->pageRepo->saveUpdateDraft($this->page, ['html' => $newContent]); + $this->actingAs($newUser)->visit($this->page->getUrl() . '/edit') + ->dontSeeInField('html', $newContent); + } + + public function test_alert_message_shows_if_editing_draft() + { + $this->asAdmin(); + $this->pageRepo->saveUpdateDraft($this->page, ['html' => 'test content']); + $this->asAdmin()->visit($this->page->getUrl() . '/edit') + ->see('You are currently editing a draft'); + } + + public function test_alert_message_shows_if_someone_else_editing() + { + $addedContent = '

test message content

'; + $this->asAdmin()->visit($this->page->getUrl() . '/edit') + ->dontSeeInField('html', $addedContent); + + $newContent = $this->page->html . $addedContent; + $newUser = $this->getNewUser(); + $this->pageRepo->saveUpdateDraft($this->page, ['html' => $newContent]); + $this->actingAs($newUser)->visit($this->page->getUrl() . '/edit') + ->see('Admin has started editing this page'); + } + +} diff --git a/tests/RestrictionsTest.php b/tests/Permissions/RestrictionsTest.php similarity index 100% rename from tests/RestrictionsTest.php rename to tests/Permissions/RestrictionsTest.php diff --git a/tests/RolesTest.php b/tests/Permissions/RolesTest.php similarity index 100% rename from tests/RolesTest.php rename to tests/Permissions/RolesTest.php