Attempt to fix flaky tests

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2025-07-21 22:18:15 +01:00
parent f3e288d078
commit 1adc9f1aa9
7 changed files with 7 additions and 6 deletions

View File

@@ -93,6 +93,7 @@ class UploadedFilesController extends Controller
'id',
'filename',
'action_type',
'action_date',
'note',
'created_at',
];

View File

@@ -103,7 +103,7 @@ class AccessoryFilesTest extends TestCase
// Upload a file
$this->actingAsForApi($user)
->post(
route('api.files.store', ['object_type' => 'accessories', 'id' => $accessory->id]), [
route('api.files.store', ['object_type' => 'accessories', 'id' => $accessory->id, 'order' => 'asc']), [
'file' => [UploadedFile::fake()->create("test.jpg", 100)],
]
)

View File

@@ -134,7 +134,7 @@ class AssetModelFilesTest extends TestCase
// List the files to get the file ID
$result = $this->actingAsForApi($user)
->getJson(
route('api.files.index', ['object_type' => 'models', 'id' => $model->id])
route('api.files.index', ['object_type' => 'models', 'id' => $model->id, 'order' => 'asc'])
)
->assertOk()
->assertJsonStructure(

View File

@@ -103,7 +103,7 @@ class ConsumableFileTest extends TestCase
// Upload a file
$this->actingAsForApi($user)
->post(
route('api.files.store', ['object_type' => 'consumables', 'id' => $consumable->id]), [
route('api.files.store', ['object_type' => 'consumables', 'id' => $consumable->id, 'order' => 'asc']), [
'file' => [UploadedFile::fake()->create("test.jpg", 100)],
]
)

View File

@@ -134,7 +134,7 @@ class LicenseUploadTest extends TestCase
// List the files to get the file ID
$result = $this->actingAsForApi($user)
->getJson(
route('api.files.index', ['object_type' => 'licenses', 'id' => $license->id])
route('api.files.index', ['object_type' => 'licenses', 'id' => $license->id, 'order' => 'asc'])
)
->assertOk()
->assertJsonStructure(

View File

@@ -132,7 +132,7 @@ class LocationFileTest extends TestCase
// List the files to get the file ID
$result = $this->actingAsForApi($user)
->getJson(
route('api.files.index', ['object_type' => 'locations', 'id' => $location->id])
route('api.files.index', ['object_type' => 'locations', 'id' => $location->id, 'order' => 'asc'])
)
->assertOk()
->assertJsonStructure(

View File

@@ -131,7 +131,7 @@ class UserFileTest extends TestCase
// List the files to get the file ID
$result = $this->actingAsForApi($admin)
->getJson(
route('api.files.index', ['object_type' => 'users', 'id' => $user->id])
route('api.files.index', ['object_type' => 'users', 'id' => $user->id, 'order' => 'asc'])
)
->assertOk()
->assertJsonStructure(