1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Revisions: Hid changes link for oldest revision

Just as a UX improvement to help avoid confusion, as the whole content
will be changes for this revision.

For #5454
This commit is contained in:
Dan Brown
2025-03-16 11:59:42 +00:00
parent 4f5ad171ac
commit dfbc78947f
4 changed files with 22 additions and 4 deletions

View File

@ -203,6 +203,18 @@ class PageRevisionTest extends TestCase
$this->withHtml($resp)->assertElementContains('.item-list-row > div:nth-child(2)', 'Markdown)');
}
public function test_revision_changes_link_not_shown_for_oldest_revision()
{
$page = $this->entities->page();
$this->createRevisions($page, 3, ['html' => 'new page html']);
$resp = $this->asAdmin()->get($page->refresh()->getUrl('/revisions'));
$html = $this->withHtml($resp);
$html->assertElementNotExists('.item-list > .item-list-row:last-child a[href*="/changes"]');
$html->assertElementContains('.item-list > .item-list-row:nth-child(2)', 'Changes');
}
public function test_revision_restore_action_only_visible_with_permission()
{
$page = $this->entities->page();