A free open source IT asset/license management system
Attempt to fix flaky tests
snipe1adc9f1aa9c4
diff --git a/app/Http/Controllers/Api/UploadedFilesController.php b/app/Http/Controllers/Api/UploadedFilesController.phpindex ed7a716dcf..b28e0f95ee 100644--- a/app/Http/Controllers/Api/UploadedFilesController.php+++ b/app/Http/Controllers/Api/UploadedFilesController.php@@ -93,6 +93,7 @@ class UploadedFilesController extends Controller'id','filename','action_type',+ 'action_date','note','created_at',];diff --git a/tests/Feature/Accessories/Api/AccessoryFilesTest.php b/tests/Feature/Accessories/Api/AccessoryFilesTest.phpindex 9e5088082b..376e08247b 100644--- a/tests/Feature/Accessories/Api/AccessoryFilesTest.php+++ b/tests/Feature/Accessories/Api/AccessoryFilesTest.php@@ -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)],])diff --git a/tests/Feature/AssetModels/Api/AssetModelFilesTest.php b/tests/Feature/AssetModels/Api/AssetModelFilesTest.phpindex 79e5786a48..9294921617 100644--- a/tests/Feature/AssetModels/Api/AssetModelFilesTest.php+++ b/tests/Feature/AssetModels/Api/AssetModelFilesTest.php@@ -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(diff --git a/tests/Feature/Consumables/Api/ConsumableFileTest.php b/tests/Feature/Consumables/Api/ConsumableFileTest.phpindex 7fc2bc10cb..f748a29a00 100644--- a/tests/Feature/Consumables/Api/ConsumableFileTest.php+++ b/tests/Feature/Consumables/Api/ConsumableFileTest.php@@ -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)],])diff --git a/tests/Feature/Licenses/Api/LicenseUploadTest.php b/tests/Feature/Licenses/Api/LicenseUploadTest.phpindex ed46f7d199..50dac35da4 100644--- a/tests/Feature/Licenses/Api/LicenseUploadTest.php+++ b/tests/Feature/Licenses/Api/LicenseUploadTest.php@@ -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(diff --git a/tests/Feature/Locations/Api/LocationFileTest.php b/tests/Feature/Locations/Api/LocationFileTest.phpindex bf4680ffff..50c18050f3 100644--- a/tests/Feature/Locations/Api/LocationFileTest.php+++ b/tests/Feature/Locations/Api/LocationFileTest.php@@ -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(diff --git a/tests/Feature/Users/Api/UserFileTest.php b/tests/Feature/Users/Api/UserFileTest.phpindex 85528706ca..5128b3d407 100644--- a/tests/Feature/Users/Api/UserFileTest.php+++ b/tests/Feature/Users/Api/UserFileTest.php@@ -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(