3
0
mirror of https://github.com/snipe/snipe-it.git synced 2025-10-29 11:21:21 +00:00

Merge pull request #17454 from uberbrady/de_flake_action_log_tests

Enforce order by ID for actionlog tests
This commit is contained in:
snipe 2025-07-23 15:06:09 +01:00 committed by GitHub
commit 83a19fbbbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,8 @@ trait AssertHasActionLogs
{
public function assertHasTheseActionLogs(Model $item, array $statuses)
{
Assert::assertEquals($statuses, $item->assetlog()->orderBy('id')->pluck('action_type')->toArray(), "Failed asserting that action logs match");
//note we have to do a 'reorder()' here because there is an implicit "order_by created_at" baked in to the relationship
Assert::assertEquals($statuses, $item->assetlog()->reorder('id')->pluck('action_type')->toArray(), "Failed asserting that action logs match");
}
}