@@ -276,6 +276,42 @@ public function test_recently_updated_pages_view_shows_updated_by_details()
276276 $ resp ->assertElementContains ('.entity-list .page:nth-child(1) ' , 'Updated 1 second ago by ' . $ user ->name );
277277 }
278278
279+ public function test_recently_updated_pages_view_shows_parent_chain ()
280+ {
281+ $ user = $ this ->getEditor ();
282+ /** @var Page $page */
283+ $ page = Page::query ()->whereNotNull ('chapter_id ' )->first ();
284+
285+ $ this ->actingAs ($ user )->put ($ page ->getUrl (), [
286+ 'name ' => 'Updated title ' ,
287+ 'html ' => '<p>Updated content</p> ' ,
288+ ]);
289+
290+ $ resp = $ this ->asAdmin ()->get ('/pages/recently-updated ' );
291+ $ resp ->assertElementContains ('.entity-list .page:nth-child(1) ' , $ page ->chapter ->getShortName (42 ));
292+ $ resp ->assertElementContains ('.entity-list .page:nth-child(1) ' , $ page ->book ->getShortName (42 ));
293+ }
294+
295+ public function test_recently_updated_pages_view_does_not_show_parent_if_not_visible ()
296+ {
297+ $ user = $ this ->getEditor ();
298+ /** @var Page $page */
299+ $ page = Page::query ()->whereNotNull ('chapter_id ' )->first ();
300+
301+ $ this ->actingAs ($ user )->put ($ page ->getUrl (), [
302+ 'name ' => 'Updated title ' ,
303+ 'html ' => '<p>Updated content</p> ' ,
304+ ]);
305+
306+ $ this ->setEntityRestrictions ($ page ->book );
307+ $ this ->setEntityRestrictions ($ page , ['view ' ], [$ user ->roles ->first ()]);
308+
309+ $ resp = $ this ->get ('/pages/recently-updated ' );
310+ $ resp ->assertDontSee ($ page ->book ->getShortName (42 ));
311+ $ resp ->assertDontSee ($ page ->chapter ->getShortName (42 ));
312+ $ resp ->assertElementContains ('.entity-list .page:nth-child(1) ' , 'Updated title ' );
313+ }
314+
279315 public function test_recently_updated_pages_on_home ()
280316 {
281317 /** @var Page $page */
0 commit comments