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

@ -93,10 +93,10 @@ class UserApiTokenTest extends TestCase
$token = ApiToken::query()->latest()->first();
$resp = $this->get($editor->getEditUrl());
$resp->assertElementExists('#api_tokens');
$resp->assertElementContains('#api_tokens', $token->name);
$resp->assertElementContains('#api_tokens', $token->token_id);
$resp->assertElementContains('#api_tokens', $token->expires_at->format('Y-m-d'));
$this->withHtml($resp)->assertElementExists('#api_tokens');
$this->withHtml($resp)->assertElementContains('#api_tokens', $token->name);
$this->withHtml($resp)->assertElementContains('#api_tokens', $token->token_id);
$this->withHtml($resp)->assertElementContains('#api_tokens', $token->expires_at->format('Y-m-d'));
}
public function test_secret_shown_once_after_creation()
@ -161,7 +161,7 @@ class UserApiTokenTest extends TestCase
$resp = $this->get($tokenUrl . '/delete');
$resp->assertSeeText('Delete Token');
$resp->assertSeeText($token->name);
$resp->assertElementExists('form[action="' . $tokenUrl . '"]');
$this->withHtml($resp)->assertElementExists('form[action="' . $tokenUrl . '"]');
$resp = $this->delete($tokenUrl);
$resp->assertRedirect($editor->getEditUrl('#api_tokens'));