X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/03ee3d21bab5ef1b8fc09de27f3aa8115d947dd1..refs/pull/1576/head:/tests/Entity/EntityTest.php diff --git a/tests/Entity/EntityTest.php b/tests/Entity/EntityTest.php index 352af1e42..a3fb1cfe1 100644 --- a/tests/Entity/EntityTest.php +++ b/tests/Entity/EntityTest.php @@ -1,10 +1,12 @@ click('Sort') ->seePageIs($bookToSort->getUrl() . '/sort') ->seeStatusCode(200) - ->see($bookToSort->name) - // Ensure page shows other books - ->see($books[1]->name); + ->see($bookToSort->name); } public function test_book_sort_item_returns_book_content() @@ -192,7 +192,7 @@ class EntityTest extends BrowserKitTest $entities = $this->createEntityChainBelongingToUser($creator, $updater); $this->actingAs($creator); app(UserRepo::class)->destroy($creator); - app(EntityRepo::class)->savePageRevision($entities['page']); + app(PageRepo::class)->savePageRevision($entities['page']); $this->checkEntitiesViewable($entities); } @@ -205,7 +205,7 @@ class EntityTest extends BrowserKitTest $entities = $this->createEntityChainBelongingToUser($creator, $updater); $this->actingAs($updater); app(UserRepo::class)->destroy($updater); - app(EntityRepo::class)->savePageRevision($entities['page']); + app(PageRepo::class)->savePageRevision($entities['page']); $this->checkEntitiesViewable($entities); } @@ -222,15 +222,6 @@ class EntityTest extends BrowserKitTest ->click('Revisions')->seeStatusCode(200); } - public function test_recently_created_pages_view() - { - $user = $this->getEditor(); - $content = $this->createEntityChainBelongingToUser($user); - - $this->asAdmin()->visit('/pages/recently-created') - ->seeInNthElement('.entity-list .page', 0, $content['page']->name); - } - public function test_recently_updated_pages_view() { $user = $this->getEditor(); @@ -269,6 +260,9 @@ class EntityTest extends BrowserKitTest public function test_recently_updated_pages_on_home() { $page = Page::orderBy('updated_at', 'asc')->first(); + Page::where('id', '!=', $page->id)->update([ + 'updated_at' => Carbon::now()->subSecond(1) + ]); $this->asAdmin()->visit('/') ->dontSeeInElement('#recently-updated-pages', $page->name); $this->visit($page->getUrl() . '/edit')