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

API: Added to, and updated, testing to cover audit log additions

This commit is contained in:
Dan Brown
2024-05-05 15:44:58 +01:00
parent 3946158e88
commit 67df127c26
12 changed files with 83 additions and 23 deletions

View File

@ -153,22 +153,22 @@ class RecycleBinTest extends TestCase
$this->assertDatabaseHas('activities', [
'type' => 'page_delete',
'entity_id' => $page->id,
'entity_type' => $page->getMorphClass(),
'loggable_id' => $page->id,
'loggable_type' => $page->getMorphClass(),
]);
$this->asAdmin()->delete("/settings/recycle-bin/{$deletion->id}");
$this->assertDatabaseMissing('activities', [
'type' => 'page_delete',
'entity_id' => $page->id,
'entity_type' => $page->getMorphClass(),
'loggable_id' => $page->id,
'loggable_type' => $page->getMorphClass(),
]);
$this->assertDatabaseHas('activities', [
'type' => 'page_delete',
'entity_id' => null,
'entity_type' => null,
'loggable_id' => null,
'loggable_type' => null,
'detail' => $page->name,
]);
}