add stable secondary sorting based on id to the tests to avoid flakyness

This commit is contained in:
Gregor Vostrak
2026-07-08 18:24:04 +02:00
parent 75f5144b45
commit c90c1ed8fa
3 changed files with 8 additions and 5 deletions

View File

@@ -52,7 +52,7 @@ class ReportEndpointTest extends ApiEndpointTestAbstract
// Assert
$response->assertStatus(200);
$response->assertJsonCount(4, 'data');
$reports = Report::query()->orderBy('created_at', 'desc')->get();
$reports = Report::query()->orderBy('created_at', 'desc')->orderBy('id')->get();
$response->assertJson(fn (AssertableJson $json) => $json
->has('data')
->has('links')