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

@ -17,8 +17,8 @@ class WebhookManagementTest extends TestCase
$resp = $this->asAdmin()->get('/settings/webhooks');
$resp->assertOk();
$resp->assertElementContains('a[href$="/settings/webhooks/create"]', 'Create New Webhook');
$resp->assertElementExists('a[href="' . $webhook->getUrl() . '"]', $webhook->name);
$this->withHtml($resp)->assertElementContains('a[href$="/settings/webhooks/create"]', 'Create New Webhook');
$this->withHtml($resp)->assertElementContains('a[href="' . $webhook->getUrl() . '"]', $webhook->name);
$resp->assertSee($webhook->endpoint);
$resp->assertSee('All system events');
$resp->assertSee('Active');
@ -29,7 +29,7 @@ class WebhookManagementTest extends TestCase
$resp = $this->asAdmin()->get('/settings/webhooks/create');
$resp->assertOk();
$resp->assertSee('Create New Webhook');
$resp->assertElementContains('form[action$="/settings/webhooks/create"] button', 'Save Webhook');
$this->withHtml($resp)->assertElementContains('form[action$="/settings/webhooks/create"] button', 'Save Webhook');
}
public function test_store()
@ -70,9 +70,9 @@ class WebhookManagementTest extends TestCase
$resp = $this->asAdmin()->get('/settings/webhooks/' . $webhook->id);
$resp->assertOk();
$resp->assertSee('Edit Webhook');
$resp->assertElementContains('form[action="' . $webhook->getUrl() . '"] button', 'Save Webhook');
$resp->assertElementContains('a[href="' . $webhook->getUrl('/delete') . '"]', 'Delete Webhook');
$resp->assertElementExists('input[type="checkbox"][value="all"][name="events[]"]');
$this->withHtml($resp)->assertElementContains('form[action="' . $webhook->getUrl() . '"] button', 'Save Webhook');
$this->withHtml($resp)->assertElementContains('a[href="' . $webhook->getUrl('/delete') . '"]', 'Delete Webhook');
$this->withHtml($resp)->assertElementExists('input[type="checkbox"][value="all"][name="events[]"]');
}
public function test_update()
@ -114,7 +114,7 @@ class WebhookManagementTest extends TestCase
$resp->assertOk();
$resp->assertSee('Delete Webhook');
$resp->assertSee('This will fully delete this webhook, with the name \'Webhook to delete\', from the system.');
$resp->assertElementContains('form[action$="/settings/webhooks/' . $webhook->id . '"]', 'Delete');
$this->withHtml($resp)->assertElementContains('form[action$="/settings/webhooks/' . $webhook->id . '"]', 'Delete');
}
public function test_destroy()