From af135fa42cc948a4045dddb507c0ba8a0ef66f74 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 16 Dec 2024 17:37:58 -0800 Subject: [PATCH 1/3] Add permissions property to group factory --- database/factories/GroupFactory.php | 1 + 1 file changed, 1 insertion(+) diff --git a/database/factories/GroupFactory.php b/database/factories/GroupFactory.php index 9dee88a96..1c6eaa812 100644 --- a/database/factories/GroupFactory.php +++ b/database/factories/GroupFactory.php @@ -23,6 +23,7 @@ class GroupFactory extends Factory { return [ 'name' => $this->faker->name(), + 'permissions' => json_encode([]), ]; } } From 1be7508340445d3939bce153f8dbadf05655383d Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 16 Dec 2024 17:45:10 -0800 Subject: [PATCH 2/3] Add simple tests to ensure views render --- .../Accessories/Ui/AccessoriesIndexTest.php | 7 +++++++ .../Accessories/Ui/EditAccessoryTest.php | 17 +++++++++++++++++ .../Accessories/Ui/ShowAccessoryTest.php | 17 +++++++++++++++++ .../Ui/AssetMaintenanceIndexTest.php | 16 ++++++++++++++++ .../Ui/CreateAssetMaintenanceTest.php | 16 ++++++++++++++++ .../Ui/EditAssetMaintenanceTest.php | 17 +++++++++++++++++ .../Ui/ShowAssetMaintenanceTest.php | 17 +++++++++++++++++ .../AssetModels/Ui/CreateAssetModelsTest.php | 7 +++++++ .../AssetModels/Ui/ShowAssetModelsTest.php | 17 +++++++++++++++++ .../AssetModels/Ui/UpdateAssetModelsTest.php | 7 +++++++ tests/Feature/Assets/Ui/AssetIndexTest.php | 16 ++++++++++++++++ tests/Feature/Assets/Ui/StoreAssetsTest.php | 16 ++++++++++++++++ .../Categories/Ui/CreateCategoriesTest.php | 7 +++++++ .../Feature/Categories/Ui/ShowCategoryTest.php | 17 +++++++++++++++++ .../Categories/Ui/UpdateCategoriesTest.php | 7 +++++++ .../Checkins/Ui/AccessoryCheckinTest.php | 7 +++++++ tests/Feature/Checkins/Ui/AssetCheckinTest.php | 7 +++++++ .../Checkins/Ui/ComponentCheckinTest.php | 7 +++++++ .../Feature/Checkins/Ui/LicenseCheckinTest.php | 7 ++++++- .../Checkouts/Ui/AccessoryCheckoutTest.php | 7 +++++++ .../Feature/Checkouts/Ui/AssetCheckoutTest.php | 6 ++++++ .../Checkouts/Ui/ComponentsCheckoutTest.php | 7 +++++++ .../Checkouts/Ui/ConsumableCheckoutTest.php | 6 ++++++ .../Checkouts/Ui/LicenseCheckoutTest.php | 7 +++++++ tests/Feature/Companies/Ui/CompanyIndexTest.php | 16 ++++++++++++++++ tests/Feature/Companies/Ui/EditCompanyTest.php | 17 +++++++++++++++++ tests/Feature/Companies/Ui/ShowCompanyTest.php | 17 +++++++++++++++++ .../Feature/Components/Ui/EditComponentTest.php | 17 +++++++++++++++++ .../Feature/Components/Ui/ShowComponentTest.php | 17 +++++++++++++++++ .../Consumables/Ui/ConsumableViewTest.php | 2 +- .../Consumables/Ui/CreateConsumableTest.php | 16 ++++++++++++++++ .../Consumables/Ui/EditConsumableTest.php | 17 +++++++++++++++++ .../Departments/Ui/CreateDepartmentsTest.php | 8 ++++++++ .../Departments/Ui/IndexDepartmentsTest.php | 8 ++++++++ .../Departments/Ui/ShowDepartmentTest.php | 17 +++++++++++++++++ .../Departments/Ui/UpdateDepartmentsTest.php | 6 ++++++ .../Depreciations/Ui/CreateDepreciationTest.php | 16 ++++++++++++++++ .../Depreciations/Ui/DepreciationsIndexTest.php | 2 +- .../Depreciations/Ui/ShowDepreciationTest.php | 17 +++++++++++++++++ .../Depreciations/Ui/UpdateDepreciationTest.php | 17 +++++++++++++++++ tests/Feature/Groups/Ui/CreateGroupTest.php | 16 ++++++++++++++++ tests/Feature/Groups/Ui/ShowGroupTest.php | 17 +++++++++++++++++ tests/Feature/Groups/Ui/UpdateGroupTest.php | 17 +++++++++++++++++ tests/Feature/Importing/Ui/ImportTest.php | 16 ++++++++++++++++ tests/Feature/Licenses/Ui/CreateLicenseTest.php | 7 ++++++- tests/Feature/Licenses/Ui/LicenseViewTest.php | 7 +++++++ tests/Feature/Licenses/Ui/UpdateLicenseTest.php | 17 +++++++++++++++++ .../Locations/Ui/CreateLocationsTest.php | 7 +++++++ tests/Feature/Locations/Ui/ShowLocationTest.php | 17 +++++++++++++++++ .../Locations/Ui/UpdateLocationsTest.php | 6 ++++++ .../Manufacturers/Ui/CreateManufacturerTest.php | 16 ++++++++++++++++ .../Manufacturers/Ui/IndexManufacturersTest.php | 16 ++++++++++++++++ .../Manufacturers/Ui/ShowManufacturerTest.php | 17 +++++++++++++++++ .../Manufacturers/Ui/UpdateManufacturerTest.php | 17 +++++++++++++++++ .../Ui/CreatePredefinedKitTest.php | 16 ++++++++++++++++ .../Ui/IndexPredefinedKitsTest.php | 16 ++++++++++++++++ .../PredefinedKits/Ui/ShowPredefinedKitTest.php | 17 +++++++++++++++++ .../Ui/UpdatePredefinedKitTest.php | 17 +++++++++++++++++ .../StatusLabels/Ui/CreateStatusLabelTest.php | 16 ++++++++++++++++ .../StatusLabels/Ui/IndexStatusLabelsTest.php | 16 ++++++++++++++++ .../StatusLabels/Ui/ShowStatusLabelTest.php | 17 +++++++++++++++++ .../StatusLabels/Ui/UpdateStatusLabelTest.php | 17 +++++++++++++++++ .../Feature/Suppliers/Ui/CreateSupplierTest.php | 16 ++++++++++++++++ .../Feature/Suppliers/Ui/IndexSuppliersTest.php | 16 ++++++++++++++++ tests/Feature/Suppliers/Ui/ShowSupplierTest.php | 17 +++++++++++++++++ .../Feature/Suppliers/Ui/UpdateSupplierTest.php | 17 +++++++++++++++++ tests/Feature/Users/Ui/CreateUserTest.php | 16 ++++++++++++++++ tests/Feature/Users/Ui/IndexUsersTest.php | 16 ++++++++++++++++ tests/Feature/Users/Ui/UpdateUserTest.php | 7 +++++++ 69 files changed, 898 insertions(+), 4 deletions(-) create mode 100644 tests/Feature/Accessories/Ui/EditAccessoryTest.php create mode 100644 tests/Feature/Accessories/Ui/ShowAccessoryTest.php create mode 100644 tests/Feature/AssetMaintenances/Ui/AssetMaintenanceIndexTest.php create mode 100644 tests/Feature/AssetMaintenances/Ui/CreateAssetMaintenanceTest.php create mode 100644 tests/Feature/AssetMaintenances/Ui/EditAssetMaintenanceTest.php create mode 100644 tests/Feature/AssetMaintenances/Ui/ShowAssetMaintenanceTest.php create mode 100644 tests/Feature/AssetModels/Ui/ShowAssetModelsTest.php create mode 100644 tests/Feature/Assets/Ui/AssetIndexTest.php create mode 100644 tests/Feature/Assets/Ui/StoreAssetsTest.php create mode 100644 tests/Feature/Categories/Ui/ShowCategoryTest.php create mode 100644 tests/Feature/Companies/Ui/CompanyIndexTest.php create mode 100644 tests/Feature/Companies/Ui/EditCompanyTest.php create mode 100644 tests/Feature/Companies/Ui/ShowCompanyTest.php create mode 100644 tests/Feature/Components/Ui/EditComponentTest.php create mode 100644 tests/Feature/Components/Ui/ShowComponentTest.php create mode 100644 tests/Feature/Consumables/Ui/CreateConsumableTest.php create mode 100644 tests/Feature/Consumables/Ui/EditConsumableTest.php create mode 100644 tests/Feature/Departments/Ui/ShowDepartmentTest.php create mode 100644 tests/Feature/Depreciations/Ui/CreateDepreciationTest.php create mode 100644 tests/Feature/Depreciations/Ui/ShowDepreciationTest.php create mode 100644 tests/Feature/Depreciations/Ui/UpdateDepreciationTest.php create mode 100644 tests/Feature/Groups/Ui/CreateGroupTest.php create mode 100644 tests/Feature/Groups/Ui/ShowGroupTest.php create mode 100644 tests/Feature/Groups/Ui/UpdateGroupTest.php create mode 100644 tests/Feature/Importing/Ui/ImportTest.php create mode 100644 tests/Feature/Licenses/Ui/UpdateLicenseTest.php create mode 100644 tests/Feature/Locations/Ui/ShowLocationTest.php create mode 100644 tests/Feature/Manufacturers/Ui/CreateManufacturerTest.php create mode 100644 tests/Feature/Manufacturers/Ui/IndexManufacturersTest.php create mode 100644 tests/Feature/Manufacturers/Ui/ShowManufacturerTest.php create mode 100644 tests/Feature/Manufacturers/Ui/UpdateManufacturerTest.php create mode 100644 tests/Feature/PredefinedKits/Ui/CreatePredefinedKitTest.php create mode 100644 tests/Feature/PredefinedKits/Ui/IndexPredefinedKitsTest.php create mode 100644 tests/Feature/PredefinedKits/Ui/ShowPredefinedKitTest.php create mode 100644 tests/Feature/PredefinedKits/Ui/UpdatePredefinedKitTest.php create mode 100644 tests/Feature/StatusLabels/Ui/CreateStatusLabelTest.php create mode 100644 tests/Feature/StatusLabels/Ui/IndexStatusLabelsTest.php create mode 100644 tests/Feature/StatusLabels/Ui/ShowStatusLabelTest.php create mode 100644 tests/Feature/StatusLabels/Ui/UpdateStatusLabelTest.php create mode 100644 tests/Feature/Suppliers/Ui/CreateSupplierTest.php create mode 100644 tests/Feature/Suppliers/Ui/IndexSuppliersTest.php create mode 100644 tests/Feature/Suppliers/Ui/ShowSupplierTest.php create mode 100644 tests/Feature/Suppliers/Ui/UpdateSupplierTest.php create mode 100644 tests/Feature/Users/Ui/CreateUserTest.php create mode 100644 tests/Feature/Users/Ui/IndexUsersTest.php diff --git a/tests/Feature/Accessories/Ui/AccessoriesIndexTest.php b/tests/Feature/Accessories/Ui/AccessoriesIndexTest.php index ea355f9a9..110fbf879 100644 --- a/tests/Feature/Accessories/Ui/AccessoriesIndexTest.php +++ b/tests/Feature/Accessories/Ui/AccessoriesIndexTest.php @@ -13,4 +13,11 @@ class AccessoriesIndexTest extends TestCase ->get(route('accessories.index')) ->assertForbidden(); } + + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('accessories.index')) + ->assertOk(); + } } diff --git a/tests/Feature/Accessories/Ui/EditAccessoryTest.php b/tests/Feature/Accessories/Ui/EditAccessoryTest.php new file mode 100644 index 000000000..ce880602e --- /dev/null +++ b/tests/Feature/Accessories/Ui/EditAccessoryTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('accessories.edit', Accessory::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Accessories/Ui/ShowAccessoryTest.php b/tests/Feature/Accessories/Ui/ShowAccessoryTest.php new file mode 100644 index 000000000..233855922 --- /dev/null +++ b/tests/Feature/Accessories/Ui/ShowAccessoryTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('accessories.show', Accessory::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/AssetMaintenances/Ui/AssetMaintenanceIndexTest.php b/tests/Feature/AssetMaintenances/Ui/AssetMaintenanceIndexTest.php new file mode 100644 index 000000000..4f8769000 --- /dev/null +++ b/tests/Feature/AssetMaintenances/Ui/AssetMaintenanceIndexTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('maintenances.index')) + ->assertOk(); + } +} diff --git a/tests/Feature/AssetMaintenances/Ui/CreateAssetMaintenanceTest.php b/tests/Feature/AssetMaintenances/Ui/CreateAssetMaintenanceTest.php new file mode 100644 index 000000000..6bfa46ed9 --- /dev/null +++ b/tests/Feature/AssetMaintenances/Ui/CreateAssetMaintenanceTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('maintenances.create')) + ->assertOk(); + } +} diff --git a/tests/Feature/AssetMaintenances/Ui/EditAssetMaintenanceTest.php b/tests/Feature/AssetMaintenances/Ui/EditAssetMaintenanceTest.php new file mode 100644 index 000000000..0b3b68108 --- /dev/null +++ b/tests/Feature/AssetMaintenances/Ui/EditAssetMaintenanceTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('maintenances.edit', AssetMaintenance::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/AssetMaintenances/Ui/ShowAssetMaintenanceTest.php b/tests/Feature/AssetMaintenances/Ui/ShowAssetMaintenanceTest.php new file mode 100644 index 000000000..da9ef8fa4 --- /dev/null +++ b/tests/Feature/AssetMaintenances/Ui/ShowAssetMaintenanceTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('maintenances.show', AssetMaintenance::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/AssetModels/Ui/CreateAssetModelsTest.php b/tests/Feature/AssetModels/Ui/CreateAssetModelsTest.php index b0c6f65a5..20772253a 100644 --- a/tests/Feature/AssetModels/Ui/CreateAssetModelsTest.php +++ b/tests/Feature/AssetModels/Ui/CreateAssetModelsTest.php @@ -19,6 +19,13 @@ class CreateAssetModelsTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('models.create')) + ->assertOk(); + } + public function testUserCanCreateAssetModels() { $this->assertFalse(AssetModel::where('name', 'Test Model')->exists()); diff --git a/tests/Feature/AssetModels/Ui/ShowAssetModelsTest.php b/tests/Feature/AssetModels/Ui/ShowAssetModelsTest.php new file mode 100644 index 000000000..8b4104adc --- /dev/null +++ b/tests/Feature/AssetModels/Ui/ShowAssetModelsTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('models.show', AssetModel::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/AssetModels/Ui/UpdateAssetModelsTest.php b/tests/Feature/AssetModels/Ui/UpdateAssetModelsTest.php index 95eb592b6..d0dbb2ffc 100644 --- a/tests/Feature/AssetModels/Ui/UpdateAssetModelsTest.php +++ b/tests/Feature/AssetModels/Ui/UpdateAssetModelsTest.php @@ -21,6 +21,13 @@ class UpdateAssetModelsTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('models.edit', AssetModel::factory()->create()->id)) + ->assertOk(); + } + public function testUserCanEditAssetModels() { $category = Category::factory()->forAssets()->create(); diff --git a/tests/Feature/Assets/Ui/AssetIndexTest.php b/tests/Feature/Assets/Ui/AssetIndexTest.php new file mode 100644 index 000000000..6963caf28 --- /dev/null +++ b/tests/Feature/Assets/Ui/AssetIndexTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('hardware.index')) + ->assertOk(); + } +} diff --git a/tests/Feature/Assets/Ui/StoreAssetsTest.php b/tests/Feature/Assets/Ui/StoreAssetsTest.php new file mode 100644 index 000000000..8abea545c --- /dev/null +++ b/tests/Feature/Assets/Ui/StoreAssetsTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('hardware.create')) + ->assertOk(); + } +} diff --git a/tests/Feature/Categories/Ui/CreateCategoriesTest.php b/tests/Feature/Categories/Ui/CreateCategoriesTest.php index 87312ad25..45e821d9d 100644 --- a/tests/Feature/Categories/Ui/CreateCategoriesTest.php +++ b/tests/Feature/Categories/Ui/CreateCategoriesTest.php @@ -19,6 +19,13 @@ class CreateCategoriesTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('categories.create')) + ->assertOk(); + } + public function testUserCanCreateCategories() { $this->assertFalse(Category::where('name', 'Test Category')->exists()); diff --git a/tests/Feature/Categories/Ui/ShowCategoryTest.php b/tests/Feature/Categories/Ui/ShowCategoryTest.php new file mode 100644 index 000000000..dd22b1d75 --- /dev/null +++ b/tests/Feature/Categories/Ui/ShowCategoryTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('categories.show', Category::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Categories/Ui/UpdateCategoriesTest.php b/tests/Feature/Categories/Ui/UpdateCategoriesTest.php index 98b67c7d3..901b77958 100644 --- a/tests/Feature/Categories/Ui/UpdateCategoriesTest.php +++ b/tests/Feature/Categories/Ui/UpdateCategoriesTest.php @@ -20,6 +20,13 @@ class UpdateCategoriesTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('categories.edit', Category::factory()->create()->id)) + ->assertOk(); + } + public function testUserCanCreateCategories() { $this->actingAs(User::factory()->superuser()->create()) diff --git a/tests/Feature/Checkins/Ui/AccessoryCheckinTest.php b/tests/Feature/Checkins/Ui/AccessoryCheckinTest.php index dd5f944b8..75df0a0a1 100644 --- a/tests/Feature/Checkins/Ui/AccessoryCheckinTest.php +++ b/tests/Feature/Checkins/Ui/AccessoryCheckinTest.php @@ -23,6 +23,13 @@ class AccessoryCheckinTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('accessories.checkin.show', Accessory::factory()->checkedOutToUser()->create()->id)) + ->assertOk(); + } + public function testAccessoryCanBeCheckedIn() { Event::fake([CheckoutableCheckedIn::class]); diff --git a/tests/Feature/Checkins/Ui/AssetCheckinTest.php b/tests/Feature/Checkins/Ui/AssetCheckinTest.php index f412d4439..7428b7ab7 100644 --- a/tests/Feature/Checkins/Ui/AssetCheckinTest.php +++ b/tests/Feature/Checkins/Ui/AssetCheckinTest.php @@ -42,6 +42,13 @@ class AssetCheckinTest extends TestCase ->assertRedirect(route('hardware.index')); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('hardware.checkin.create', Asset::factory()->assignedToUser()->create())) + ->assertOk(); + } + public function testAssetCanBeCheckedIn() { Event::fake([CheckoutableCheckedIn::class]); diff --git a/tests/Feature/Checkins/Ui/ComponentCheckinTest.php b/tests/Feature/Checkins/Ui/ComponentCheckinTest.php index 06754d33c..6ca921d0d 100644 --- a/tests/Feature/Checkins/Ui/ComponentCheckinTest.php +++ b/tests/Feature/Checkins/Ui/ComponentCheckinTest.php @@ -22,6 +22,13 @@ class ComponentCheckinTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('components.checkin.show', Component::factory()->checkedOutToAsset()->create()->id)) + ->assertOk(); + } + public function testComponentCheckinPagePostIsRedirectedIfRedirectSelectionIsIndex() { $component = Component::factory()->checkedOutToAsset()->create(); diff --git a/tests/Feature/Checkins/Ui/LicenseCheckinTest.php b/tests/Feature/Checkins/Ui/LicenseCheckinTest.php index e087cb442..f006e4186 100644 --- a/tests/Feature/Checkins/Ui/LicenseCheckinTest.php +++ b/tests/Feature/Checkins/Ui/LicenseCheckinTest.php @@ -17,5 +17,10 @@ class LicenseCheckinTest extends TestCase ->assertForbidden(); } - + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('licenses.checkin', LicenseSeat::factory()->assignedToUser()->create()->id)) + ->assertOk(); + } } diff --git a/tests/Feature/Checkouts/Ui/AccessoryCheckoutTest.php b/tests/Feature/Checkouts/Ui/AccessoryCheckoutTest.php index af9b28672..ff121bc4d 100644 --- a/tests/Feature/Checkouts/Ui/AccessoryCheckoutTest.php +++ b/tests/Feature/Checkouts/Ui/AccessoryCheckoutTest.php @@ -22,6 +22,13 @@ class AccessoryCheckoutTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('accessories.checkout.show', Accessory::factory()->create()->id)) + ->assertOk(); + } + public function testValidationWhenCheckingOutAccessory() { $accessory = Accessory::factory()->create(); diff --git a/tests/Feature/Checkouts/Ui/AssetCheckoutTest.php b/tests/Feature/Checkouts/Ui/AssetCheckoutTest.php index f268a9385..80aac3c4f 100644 --- a/tests/Feature/Checkouts/Ui/AssetCheckoutTest.php +++ b/tests/Feature/Checkouts/Ui/AssetCheckoutTest.php @@ -118,6 +118,12 @@ class AssetCheckoutTest extends TestCase Event::assertNotDispatched(CheckoutableCheckedOut::class); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('hardware.checkout.create', Asset::factory()->create())) + ->assertOk(); + } /** * This data provider contains checkout targets along with the * asset's expected location after the checkout process. diff --git a/tests/Feature/Checkouts/Ui/ComponentsCheckoutTest.php b/tests/Feature/Checkouts/Ui/ComponentsCheckoutTest.php index e2e91823c..507b26243 100644 --- a/tests/Feature/Checkouts/Ui/ComponentsCheckoutTest.php +++ b/tests/Feature/Checkouts/Ui/ComponentsCheckoutTest.php @@ -21,6 +21,13 @@ class ComponentsCheckoutTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('components.checkout.show', Component::factory()->create()->id)) + ->assertOk(); + } + public function test_cannot_checkout_across_companies_when_full_company_support_enabled() { Event::fake([CheckoutableCheckedOut::class]); diff --git a/tests/Feature/Checkouts/Ui/ConsumableCheckoutTest.php b/tests/Feature/Checkouts/Ui/ConsumableCheckoutTest.php index 2dc5fa62c..dd77e19c5 100644 --- a/tests/Feature/Checkouts/Ui/ConsumableCheckoutTest.php +++ b/tests/Feature/Checkouts/Ui/ConsumableCheckoutTest.php @@ -22,6 +22,12 @@ class ConsumableCheckoutTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('consumables.checkout.show', Consumable::factory()->create()->id)) + ->assertOk(); + } public function testValidationWhenCheckingOutConsumable() { $this->actingAs(User::factory()->checkoutConsumables()->create()) diff --git a/tests/Feature/Checkouts/Ui/LicenseCheckoutTest.php b/tests/Feature/Checkouts/Ui/LicenseCheckoutTest.php index 9511c3ae3..22bdb6b5d 100644 --- a/tests/Feature/Checkouts/Ui/LicenseCheckoutTest.php +++ b/tests/Feature/Checkouts/Ui/LicenseCheckoutTest.php @@ -10,6 +10,13 @@ use Tests\TestCase; class LicenseCheckoutTest extends TestCase { + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('licenses.checkout', License::factory()->create()->id)) + ->assertOk(); + } + public function testNotesAreStoredInActionLogOnCheckoutToAsset() { $admin = User::factory()->superuser()->create(); diff --git a/tests/Feature/Companies/Ui/CompanyIndexTest.php b/tests/Feature/Companies/Ui/CompanyIndexTest.php new file mode 100644 index 000000000..5e768f41b --- /dev/null +++ b/tests/Feature/Companies/Ui/CompanyIndexTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('companies.index')) + ->assertOk(); + } +} diff --git a/tests/Feature/Companies/Ui/EditCompanyTest.php b/tests/Feature/Companies/Ui/EditCompanyTest.php new file mode 100644 index 000000000..7dcbc7908 --- /dev/null +++ b/tests/Feature/Companies/Ui/EditCompanyTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('companies.edit', Company::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Companies/Ui/ShowCompanyTest.php b/tests/Feature/Companies/Ui/ShowCompanyTest.php new file mode 100644 index 000000000..1c41f6ab2 --- /dev/null +++ b/tests/Feature/Companies/Ui/ShowCompanyTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('companies.show', Company::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Components/Ui/EditComponentTest.php b/tests/Feature/Components/Ui/EditComponentTest.php new file mode 100644 index 000000000..257034390 --- /dev/null +++ b/tests/Feature/Components/Ui/EditComponentTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('components.edit', Component::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Components/Ui/ShowComponentTest.php b/tests/Feature/Components/Ui/ShowComponentTest.php new file mode 100644 index 000000000..50a17ee05 --- /dev/null +++ b/tests/Feature/Components/Ui/ShowComponentTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('components.show', Component::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Consumables/Ui/ConsumableViewTest.php b/tests/Feature/Consumables/Ui/ConsumableViewTest.php index 9633896c2..42c98a185 100644 --- a/tests/Feature/Consumables/Ui/ConsumableViewTest.php +++ b/tests/Feature/Consumables/Ui/ConsumableViewTest.php @@ -16,7 +16,7 @@ class ConsumableViewTest extends TestCase ->assertForbidden(); } - public function testUserCanListConsumables() + public function testUserCanViewAConsumable() { $consumable = Consumable::factory()->create(); $this->actingAs(User::factory()->superuser()->create()) diff --git a/tests/Feature/Consumables/Ui/CreateConsumableTest.php b/tests/Feature/Consumables/Ui/CreateConsumableTest.php new file mode 100644 index 000000000..fd8bc235c --- /dev/null +++ b/tests/Feature/Consumables/Ui/CreateConsumableTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('consumables.create')) + ->assertOk(); + } +} diff --git a/tests/Feature/Consumables/Ui/EditConsumableTest.php b/tests/Feature/Consumables/Ui/EditConsumableTest.php new file mode 100644 index 000000000..6b75db127 --- /dev/null +++ b/tests/Feature/Consumables/Ui/EditConsumableTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('consumables.show', Consumable::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Departments/Ui/CreateDepartmentsTest.php b/tests/Feature/Departments/Ui/CreateDepartmentsTest.php index 17045cbc0..08dc12ba0 100644 --- a/tests/Feature/Departments/Ui/CreateDepartmentsTest.php +++ b/tests/Feature/Departments/Ui/CreateDepartmentsTest.php @@ -2,6 +2,7 @@ namespace Tests\Feature\Departments\Ui; +use App\Models\Component; use App\Models\Department; use App\Models\Company; use App\Models\User; @@ -9,6 +10,13 @@ use Tests\TestCase; class CreateDepartmentsTest extends TestCase { + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('departments.create')) + ->assertOk(); + } + public function testPermissionRequiredToCreateDepartment() { $this->actingAs(User::factory()->create()) diff --git a/tests/Feature/Departments/Ui/IndexDepartmentsTest.php b/tests/Feature/Departments/Ui/IndexDepartmentsTest.php index 461ec8fff..68caa29b2 100644 --- a/tests/Feature/Departments/Ui/IndexDepartmentsTest.php +++ b/tests/Feature/Departments/Ui/IndexDepartmentsTest.php @@ -2,6 +2,7 @@ namespace Tests\Feature\Departments\Ui; +use App\Models\Component; use App\Models\User; use Tests\TestCase; @@ -14,6 +15,13 @@ class IndexDepartmentsTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('components.index')) + ->assertOk(); + } + public function testUserCanListDepartments() { $this->actingAs(User::factory()->superuser()->create()) diff --git a/tests/Feature/Departments/Ui/ShowDepartmentTest.php b/tests/Feature/Departments/Ui/ShowDepartmentTest.php new file mode 100644 index 000000000..d8a007bde --- /dev/null +++ b/tests/Feature/Departments/Ui/ShowDepartmentTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('departments.show', Department::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Departments/Ui/UpdateDepartmentsTest.php b/tests/Feature/Departments/Ui/UpdateDepartmentsTest.php index e6e614d32..71f7cfe47 100644 --- a/tests/Feature/Departments/Ui/UpdateDepartmentsTest.php +++ b/tests/Feature/Departments/Ui/UpdateDepartmentsTest.php @@ -19,6 +19,12 @@ class UpdateDepartmentsTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('departments.edit', Department::factory()->create()->id)) + ->assertOk(); + } public function testUserCanEditDepartments() { diff --git a/tests/Feature/Depreciations/Ui/CreateDepreciationTest.php b/tests/Feature/Depreciations/Ui/CreateDepreciationTest.php new file mode 100644 index 000000000..608194971 --- /dev/null +++ b/tests/Feature/Depreciations/Ui/CreateDepreciationTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('depreciations.create')) + ->assertOk(); + } +} diff --git a/tests/Feature/Depreciations/Ui/DepreciationsIndexTest.php b/tests/Feature/Depreciations/Ui/DepreciationsIndexTest.php index 90cb39b4e..85ca2e55d 100644 --- a/tests/Feature/Depreciations/Ui/DepreciationsIndexTest.php +++ b/tests/Feature/Depreciations/Ui/DepreciationsIndexTest.php @@ -1,6 +1,6 @@ actingAs(User::factory()->superuser()->create()) + ->get(route('depreciations.show', Depreciation::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Depreciations/Ui/UpdateDepreciationTest.php b/tests/Feature/Depreciations/Ui/UpdateDepreciationTest.php new file mode 100644 index 000000000..66fbb6f74 --- /dev/null +++ b/tests/Feature/Depreciations/Ui/UpdateDepreciationTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('depreciations.edit', Depreciation::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Groups/Ui/CreateGroupTest.php b/tests/Feature/Groups/Ui/CreateGroupTest.php new file mode 100644 index 000000000..56b3a7605 --- /dev/null +++ b/tests/Feature/Groups/Ui/CreateGroupTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('groups.create')) + ->assertOk(); + } +} diff --git a/tests/Feature/Groups/Ui/ShowGroupTest.php b/tests/Feature/Groups/Ui/ShowGroupTest.php new file mode 100644 index 000000000..e0106c12e --- /dev/null +++ b/tests/Feature/Groups/Ui/ShowGroupTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('groups.show', Group::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Groups/Ui/UpdateGroupTest.php b/tests/Feature/Groups/Ui/UpdateGroupTest.php new file mode 100644 index 000000000..c68d7cb84 --- /dev/null +++ b/tests/Feature/Groups/Ui/UpdateGroupTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('groups.edit', Group::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Importing/Ui/ImportTest.php b/tests/Feature/Importing/Ui/ImportTest.php new file mode 100644 index 000000000..3493f47af --- /dev/null +++ b/tests/Feature/Importing/Ui/ImportTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('imports.index')) + ->assertOk(); + } +} diff --git a/tests/Feature/Licenses/Ui/CreateLicenseTest.php b/tests/Feature/Licenses/Ui/CreateLicenseTest.php index 21e6278dd..33f825bf9 100644 --- a/tests/Feature/Licenses/Ui/CreateLicenseTest.php +++ b/tests/Feature/Licenses/Ui/CreateLicenseTest.php @@ -19,7 +19,12 @@ class CreateLicenseTest extends TestCase ->assertForbidden(); } - + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('licenses.create')) + ->assertOk(); + } public function testLicenseWithoutPurchaseDateFailsValidation() { diff --git a/tests/Feature/Licenses/Ui/LicenseViewTest.php b/tests/Feature/Licenses/Ui/LicenseViewTest.php index 71d3a8beb..8bf5bf77f 100644 --- a/tests/Feature/Licenses/Ui/LicenseViewTest.php +++ b/tests/Feature/Licenses/Ui/LicenseViewTest.php @@ -16,6 +16,13 @@ class LicenseViewTest extends TestCase ->get(route('licenses.show', $license)) ->assertForbidden(); } + + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('licenses.show', License::factory()->create()->id)) + ->assertOk(); + } public function testLicenseWithPurchaseDateDepreciatesCorrectly() { diff --git a/tests/Feature/Licenses/Ui/UpdateLicenseTest.php b/tests/Feature/Licenses/Ui/UpdateLicenseTest.php new file mode 100644 index 000000000..c3d1446d5 --- /dev/null +++ b/tests/Feature/Licenses/Ui/UpdateLicenseTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('licenses.update', License::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Locations/Ui/CreateLocationsTest.php b/tests/Feature/Locations/Ui/CreateLocationsTest.php index cfcb84902..2e2e1e0aa 100644 --- a/tests/Feature/Locations/Ui/CreateLocationsTest.php +++ b/tests/Feature/Locations/Ui/CreateLocationsTest.php @@ -19,6 +19,13 @@ class CreateLocationsTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('locations.create')) + ->assertOk(); + } + public function testUserCanCreateLocations() { $this->assertFalse(Location::where('name', 'Test Location')->exists()); diff --git a/tests/Feature/Locations/Ui/ShowLocationTest.php b/tests/Feature/Locations/Ui/ShowLocationTest.php new file mode 100644 index 000000000..6afb7dfe5 --- /dev/null +++ b/tests/Feature/Locations/Ui/ShowLocationTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('locations.show', Location::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Locations/Ui/UpdateLocationsTest.php b/tests/Feature/Locations/Ui/UpdateLocationsTest.php index c692374cc..6cead815b 100644 --- a/tests/Feature/Locations/Ui/UpdateLocationsTest.php +++ b/tests/Feature/Locations/Ui/UpdateLocationsTest.php @@ -18,6 +18,12 @@ class UpdateLocationsTest extends TestCase ->assertForbidden(); } + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('locations.update', Location::factory()->create()->id)) + ->assertOk(); + } public function testUserCanEditLocations() { diff --git a/tests/Feature/Manufacturers/Ui/CreateManufacturerTest.php b/tests/Feature/Manufacturers/Ui/CreateManufacturerTest.php new file mode 100644 index 000000000..133b271ea --- /dev/null +++ b/tests/Feature/Manufacturers/Ui/CreateManufacturerTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('manufacturers.create')) + ->assertOk(); + } +} diff --git a/tests/Feature/Manufacturers/Ui/IndexManufacturersTest.php b/tests/Feature/Manufacturers/Ui/IndexManufacturersTest.php new file mode 100644 index 000000000..5c85cd14d --- /dev/null +++ b/tests/Feature/Manufacturers/Ui/IndexManufacturersTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('manufacturers.index')) + ->assertOk(); + } +} diff --git a/tests/Feature/Manufacturers/Ui/ShowManufacturerTest.php b/tests/Feature/Manufacturers/Ui/ShowManufacturerTest.php new file mode 100644 index 000000000..890feb123 --- /dev/null +++ b/tests/Feature/Manufacturers/Ui/ShowManufacturerTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('manufacturers.show', Manufacturer::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Manufacturers/Ui/UpdateManufacturerTest.php b/tests/Feature/Manufacturers/Ui/UpdateManufacturerTest.php new file mode 100644 index 000000000..e2f7724fa --- /dev/null +++ b/tests/Feature/Manufacturers/Ui/UpdateManufacturerTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('manufacturers.edit', Manufacturer::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/PredefinedKits/Ui/CreatePredefinedKitTest.php b/tests/Feature/PredefinedKits/Ui/CreatePredefinedKitTest.php new file mode 100644 index 000000000..0f958f66f --- /dev/null +++ b/tests/Feature/PredefinedKits/Ui/CreatePredefinedKitTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('kits.create')) + ->assertOk(); + } +} diff --git a/tests/Feature/PredefinedKits/Ui/IndexPredefinedKitsTest.php b/tests/Feature/PredefinedKits/Ui/IndexPredefinedKitsTest.php new file mode 100644 index 000000000..844e804f6 --- /dev/null +++ b/tests/Feature/PredefinedKits/Ui/IndexPredefinedKitsTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('kits.index')) + ->assertOk(); + } +} diff --git a/tests/Feature/PredefinedKits/Ui/ShowPredefinedKitTest.php b/tests/Feature/PredefinedKits/Ui/ShowPredefinedKitTest.php new file mode 100644 index 000000000..16d730831 --- /dev/null +++ b/tests/Feature/PredefinedKits/Ui/ShowPredefinedKitTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('kits.show', PredefinedKit::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/PredefinedKits/Ui/UpdatePredefinedKitTest.php b/tests/Feature/PredefinedKits/Ui/UpdatePredefinedKitTest.php new file mode 100644 index 000000000..6eb97471f --- /dev/null +++ b/tests/Feature/PredefinedKits/Ui/UpdatePredefinedKitTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('kits.edit', PredefinedKit::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/StatusLabels/Ui/CreateStatusLabelTest.php b/tests/Feature/StatusLabels/Ui/CreateStatusLabelTest.php new file mode 100644 index 000000000..6312ea4e3 --- /dev/null +++ b/tests/Feature/StatusLabels/Ui/CreateStatusLabelTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('statuslabels.create')) + ->assertOk(); + } +} diff --git a/tests/Feature/StatusLabels/Ui/IndexStatusLabelsTest.php b/tests/Feature/StatusLabels/Ui/IndexStatusLabelsTest.php new file mode 100644 index 000000000..97451666d --- /dev/null +++ b/tests/Feature/StatusLabels/Ui/IndexStatusLabelsTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('statuslabels.index')) + ->assertOk(); + } +} diff --git a/tests/Feature/StatusLabels/Ui/ShowStatusLabelTest.php b/tests/Feature/StatusLabels/Ui/ShowStatusLabelTest.php new file mode 100644 index 000000000..0b7389603 --- /dev/null +++ b/tests/Feature/StatusLabels/Ui/ShowStatusLabelTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('statuslabels.show', Statuslabel::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/StatusLabels/Ui/UpdateStatusLabelTest.php b/tests/Feature/StatusLabels/Ui/UpdateStatusLabelTest.php new file mode 100644 index 000000000..6726637ea --- /dev/null +++ b/tests/Feature/StatusLabels/Ui/UpdateStatusLabelTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('statuslabels.edit', Statuslabel::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Suppliers/Ui/CreateSupplierTest.php b/tests/Feature/Suppliers/Ui/CreateSupplierTest.php new file mode 100644 index 000000000..ec0765a79 --- /dev/null +++ b/tests/Feature/Suppliers/Ui/CreateSupplierTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('suppliers.create')) + ->assertOk(); + } +} diff --git a/tests/Feature/Suppliers/Ui/IndexSuppliersTest.php b/tests/Feature/Suppliers/Ui/IndexSuppliersTest.php new file mode 100644 index 000000000..e04941f6e --- /dev/null +++ b/tests/Feature/Suppliers/Ui/IndexSuppliersTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('suppliers.index')) + ->assertOk(); + } +} diff --git a/tests/Feature/Suppliers/Ui/ShowSupplierTest.php b/tests/Feature/Suppliers/Ui/ShowSupplierTest.php new file mode 100644 index 000000000..d041e179f --- /dev/null +++ b/tests/Feature/Suppliers/Ui/ShowSupplierTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('suppliers.show', Supplier::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Suppliers/Ui/UpdateSupplierTest.php b/tests/Feature/Suppliers/Ui/UpdateSupplierTest.php new file mode 100644 index 000000000..f3be72631 --- /dev/null +++ b/tests/Feature/Suppliers/Ui/UpdateSupplierTest.php @@ -0,0 +1,17 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('suppliers.edit', Supplier::factory()->create()->id)) + ->assertOk(); + } +} diff --git a/tests/Feature/Users/Ui/CreateUserTest.php b/tests/Feature/Users/Ui/CreateUserTest.php new file mode 100644 index 000000000..63d27d3d1 --- /dev/null +++ b/tests/Feature/Users/Ui/CreateUserTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('users.create')) + ->assertOk(); + } +} diff --git a/tests/Feature/Users/Ui/IndexUsersTest.php b/tests/Feature/Users/Ui/IndexUsersTest.php new file mode 100644 index 000000000..6730a3c95 --- /dev/null +++ b/tests/Feature/Users/Ui/IndexUsersTest.php @@ -0,0 +1,16 @@ +actingAs(User::factory()->superuser()->create()) + ->get(route('users.index')) + ->assertOk(); + } +} diff --git a/tests/Feature/Users/Ui/UpdateUserTest.php b/tests/Feature/Users/Ui/UpdateUserTest.php index 29f6811c7..abaec1b70 100644 --- a/tests/Feature/Users/Ui/UpdateUserTest.php +++ b/tests/Feature/Users/Ui/UpdateUserTest.php @@ -9,6 +9,13 @@ use Tests\TestCase; class UpdateUserTest extends TestCase { + public function testPageRenders() + { + $this->actingAs(User::factory()->superuser()->create()) + ->get(route('users.edit', User::factory()->create()->id)) + ->assertOk(); + } + public function testUsersCanBeActivatedWithNumber() { $admin = User::factory()->superuser()->create(); From a53976967aeb40c05bea3cffe090d8441f3245b6 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 17 Dec 2024 10:31:35 -0800 Subject: [PATCH 3/3] Use correct id --- tests/Feature/Checkins/Ui/AccessoryCheckinTest.php | 4 +++- tests/Feature/Checkins/Ui/ComponentCheckinTest.php | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/Feature/Checkins/Ui/AccessoryCheckinTest.php b/tests/Feature/Checkins/Ui/AccessoryCheckinTest.php index 75df0a0a1..a8572c618 100644 --- a/tests/Feature/Checkins/Ui/AccessoryCheckinTest.php +++ b/tests/Feature/Checkins/Ui/AccessoryCheckinTest.php @@ -25,8 +25,10 @@ class AccessoryCheckinTest extends TestCase public function testPageRenders() { + $accessory = Accessory::factory()->checkedOutToUser()->create(); + $this->actingAs(User::factory()->superuser()->create()) - ->get(route('accessories.checkin.show', Accessory::factory()->checkedOutToUser()->create()->id)) + ->get(route('accessories.checkin.show', $accessory->checkouts->first()->id)) ->assertOk(); } diff --git a/tests/Feature/Checkins/Ui/ComponentCheckinTest.php b/tests/Feature/Checkins/Ui/ComponentCheckinTest.php index 6ca921d0d..6c2ef084f 100644 --- a/tests/Feature/Checkins/Ui/ComponentCheckinTest.php +++ b/tests/Feature/Checkins/Ui/ComponentCheckinTest.php @@ -24,8 +24,12 @@ class ComponentCheckinTest extends TestCase public function testPageRenders() { + $component = Component::factory()->checkedOutToAsset()->create(); + + $componentAsset = DB::table('components_assets')->where('component_id', $component->id)->first(); + $this->actingAs(User::factory()->superuser()->create()) - ->get(route('components.checkin.show', Component::factory()->checkedOutToAsset()->create()->id)) + ->get(route('components.checkin.show', $componentAsset->id)) ->assertOk(); }