+ $user = $this->users->editor();
+ $content = $this->entities->createChainBelongingToUser($user);
+
+ $resp = $this->asAdmin()->get('/pages/recently-updated');
+ $this->withHtml($resp)->assertElementContains('.entity-list .page:nth-child(1)', $content['page']->name);
+ }
+
+ public function test_recently_updated_pages_view_shows_updated_by_details()
+ {
+ $user = $this->users->editor();
+ $page = $this->entities->page();
+
+ $this->actingAs($user)->put($page->getUrl(), [
+ 'name' => 'Updated title',
+ 'html' => '<p>Updated content</p>',
+ ]);
+
+ $resp = $this->asAdmin()->get('/pages/recently-updated');
+ $this->withHtml($resp)->assertElementContains('.entity-list .page:nth-child(1)', 'Updated 1 second ago by ' . $user->name);
+ }
+
+ public function test_recently_updated_pages_view_shows_parent_chain()
+ {
+ $user = $this->users->editor();
+ $page = $this->entities->pageWithinChapter();
+
+ $this->actingAs($user)->put($page->getUrl(), [
+ 'name' => 'Updated title',
+ 'html' => '<p>Updated content</p>',
+ ]);
+
+ $resp = $this->asAdmin()->get('/pages/recently-updated');
+ $this->withHtml($resp)->assertElementContains('.entity-list .page:nth-child(1)', $page->chapter->getShortName(42));
+ $this->withHtml($resp)->assertElementContains('.entity-list .page:nth-child(1)', $page->book->getShortName(42));
+ }
+
+ public function test_recently_updated_pages_view_does_not_show_parent_if_not_visible()
+ {
+ $user = $this->users->editor();
+ $page = $this->entities->pageWithinChapter();
+
+ $this->actingAs($user)->put($page->getUrl(), [
+ 'name' => 'Updated title',
+ 'html' => '<p>Updated content</p>',
+ ]);
+
+ $this->permissions->setEntityPermissions($page->book);
+ $this->permissions->setEntityPermissions($page, ['view'], [$user->roles->first()]);