From 1be7508340445d3939bce153f8dbadf05655383d Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 16 Dec 2024 17:45:10 -0800 Subject: [PATCH] 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 ea355f9a9d..110fbf8798 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 0000000000..ce880602e9 --- /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 0000000000..2338559225 --- /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 0000000000..4f87690008 --- /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 0000000000..6bfa46ed9e --- /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 0000000000..0b3b681085 --- /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 0000000000..da9ef8fa40 --- /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 b0c6f65a59..20772253a8 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 0000000000..8b4104adcb --- /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 95eb592b6d..d0dbb2ffc0 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 0000000000..6963caf28f --- /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 0000000000..8abea545cf --- /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 87312ad257..45e821d9d9 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 0000000000..dd22b1d751 --- /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 98b67c7d32..901b779582 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 dd5f944b82..75df0a0a11 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 f412d4439e..7428b7ab74 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 06754d33c0..6ca921d0dd 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 e087cb442d..f006e41866 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 af9b286725..ff121bc4de 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 f268a9385e..80aac3c4f3 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 e2e91823c1..507b26243f 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 2dc5fa62c0..dd77e19c5d 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 9511c3ae33..22bdb6b5db 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 0000000000..5e768f41b4 --- /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 0000000000..7dcbc7908a --- /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 0000000000..1c41f6ab2b --- /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 0000000000..2570343907 --- /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 0000000000..50a17ee059 --- /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 9633896c2d..42c98a1859 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 0000000000..fd8bc235c8 --- /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 0000000000..6b75db127f --- /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 17045cbc0b..08dc12ba09 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 461ec8fffb..68caa29b23 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 0000000000..d8a007bde3 --- /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 e6e614d32c..71f7cfe477 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 0000000000..608194971a --- /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 90cb39b4ee..85ca2e55dd 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 0000000000..66fbb6f741 --- /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 0000000000..56b3a76053 --- /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 0000000000..e0106c12ef --- /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 0000000000..c68d7cb84b --- /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 0000000000..3493f47aff --- /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 21e6278ddc..33f825bf95 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 71d3a8beb7..8bf5bf77fa 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 0000000000..c3d1446d50 --- /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 cfcb849025..2e2e1e0aa9 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 0000000000..6afb7dfe53 --- /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 c692374cc7..6cead815bc 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 0000000000..133b271ea3 --- /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 0000000000..5c85cd14df --- /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 0000000000..890feb1238 --- /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 0000000000..e2f7724fa3 --- /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 0000000000..0f958f66f8 --- /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 0000000000..844e804f68 --- /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 0000000000..16d730831c --- /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 0000000000..6eb97471fb --- /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 0000000000..6312ea4e33 --- /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 0000000000..97451666d0 --- /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 0000000000..0b7389603d --- /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 0000000000..6726637ea9 --- /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 0000000000..ec0765a796 --- /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 0000000000..e04941f6ea --- /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 0000000000..d041e179f1 --- /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 0000000000..f3be726319 --- /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 0000000000..63d27d3d1c --- /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 0000000000..6730a3c959 --- /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 29f6811c77..abaec1b70e 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();