1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Updated tests to use ssddanbrown/asserthtml package

Closes #3519
This commit is contained in:
Dan Brown
2022-07-23 15:10:18 +01:00
parent cf73e5f2c6
commit 72c8b138e1
48 changed files with 869 additions and 1014 deletions

View File

@ -28,7 +28,8 @@ class PublicActionTest extends TestCase
public function test_login_link_visible()
{
$this->setSettings(['app-public' => 'true']);
$this->get('/')->assertElementExists('a[href="' . url('/login') . '"]');
$resp = $this->get('/');
$this->withHtml($resp)->assertElementExists('a[href="' . url('/login') . '"]');
}
public function test_register_link_visible_when_enabled()
@ -96,12 +97,12 @@ class PublicActionTest extends TestCase
$chapter = Chapter::query()->first();
$resp = $this->get($chapter->getUrl());
$resp->assertSee('New Page');
$resp->assertElementExists('a[href="' . $chapter->getUrl('/create-page') . '"]');
$this->withHtml($resp)->assertElementExists('a[href="' . $chapter->getUrl('/create-page') . '"]');
$resp = $this->get($chapter->getUrl('/create-page'));
$resp->assertSee('Continue');
$resp->assertSee('Page Name');
$resp->assertElementExists('form[action="' . $chapter->getUrl('/create-guest-page') . '"]');
$this->withHtml($resp)->assertElementExists('form[action="' . $chapter->getUrl('/create-guest-page') . '"]');
$resp = $this->post($chapter->getUrl('/create-guest-page'), ['name' => 'My guest page']);
$resp->assertRedirect($chapter->book->getUrl('/page/my-guest-page/edit'));