Add simple tests to ensure views render

This commit is contained in:
Marcus Moore 2024-12-16 17:45:10 -08:00
parent af135fa42c
commit 1be7508340
No known key found for this signature in database
69 changed files with 898 additions and 4 deletions

View file

@ -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();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Accessories\Ui;
use App\Models\Accessory;
use App\Models\User;
use Tests\TestCase;
class EditAccessoryTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('accessories.edit', Accessory::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Accessories\Ui;
use App\Models\Accessory;
use App\Models\User;
use Tests\TestCase;
class ShowAccessoryTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('accessories.show', Accessory::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\AssetMaintenances\Ui;
use App\Models\User;
use Tests\TestCase;
class AssetMaintenanceIndexTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('maintenances.index'))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\AssetMaintenances\Ui;
use App\Models\User;
use Tests\TestCase;
class CreateAssetMaintenanceTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('maintenances.create'))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\AssetMaintenances\Ui;
use App\Models\AssetMaintenance;
use App\Models\User;
use Tests\TestCase;
class EditAssetMaintenanceTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('maintenances.edit', AssetMaintenance::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\AssetMaintenances\Ui;
use App\Models\AssetMaintenance;
use App\Models\User;
use Tests\TestCase;
class ShowAssetMaintenanceTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('maintenances.show', AssetMaintenance::factory()->create()->id))
->assertOk();
}
}

View file

@ -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());

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\AssetModels\Ui;
use App\Models\AssetModel;
use App\Models\User;
use Tests\TestCase;
class ShowAssetModelsTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('models.show', AssetModel::factory()->create()->id))
->assertOk();
}
}

View file

@ -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();

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Assets\Ui;
use App\Models\User;
use Tests\TestCase;
class AssetIndexTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('hardware.index'))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Assets\Ui;
use App\Models\User;
use Tests\TestCase;
class StoreAssetsTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('hardware.create'))
->assertOk();
}
}

View file

@ -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());

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Categories\Ui;
use App\Models\Category;
use App\Models\User;
use Tests\TestCase;
class ShowCategoryTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('categories.show', Category::factory()->create()->id))
->assertOk();
}
}

View file

@ -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())

View file

@ -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]);

View file

@ -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]);

View file

@ -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();

View file

@ -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();
}
}

View file

@ -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();

View file

@ -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.

View file

@ -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]);

View file

@ -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())

View file

@ -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();

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Companies\Ui;
use App\Models\User;
use Tests\TestCase;
class CompanyIndexTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('companies.index'))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Companies\Ui;
use App\Models\Company;
use App\Models\User;
use Tests\TestCase;
class EditCompanyTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('companies.edit', Company::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Companies\Ui;
use App\Models\Company;
use App\Models\User;
use Tests\TestCase;
class ShowCompanyTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('companies.show', Company::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Components\Ui;
use App\Models\Component;
use App\Models\User;
use Tests\TestCase;
class EditComponentTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('components.edit', Component::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Components\Ui;
use App\Models\Component;
use App\Models\User;
use Tests\TestCase;
class ShowComponentTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('components.show', Component::factory()->create()->id))
->assertOk();
}
}

View file

@ -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())

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Consumables\Ui;
use App\Models\User;
use Tests\TestCase;
class CreateConsumableTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('consumables.create'))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Consumables\Ui;
use App\Models\Consumable;
use App\Models\User;
use Tests\TestCase;
class EditConsumableTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('consumables.show', Consumable::factory()->create()->id))
->assertOk();
}
}

View file

@ -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())

View file

@ -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())

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Departments\Ui;
use App\Models\Department;
use App\Models\User;
use Tests\TestCase;
class ShowDepartmentTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('departments.show', Department::factory()->create()->id))
->assertOk();
}
}

View file

@ -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()
{

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Depreciations\Ui;
use App\Models\User;
use Tests\TestCase;
class CreateDepreciationTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('depreciations.create'))
->assertOk();
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Tests\Feature\Categories\Ui;
namespace Tests\Feature\Depreciations\Ui;
use App\Models\User;
use Tests\TestCase;

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Depreciations\Ui;
use App\Models\Depreciation;
use App\Models\User;
use Tests\TestCase;
class ShowDepreciationTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('depreciations.show', Depreciation::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Depreciations\Ui;
use App\Models\Depreciation;
use App\Models\User;
use Tests\TestCase;
class UpdateDepreciationTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('depreciations.edit', Depreciation::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Groups\Ui;
use App\Models\User;
use Tests\TestCase;
class CreateGroupTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('groups.create'))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Groups\Ui;
use App\Models\Group;
use App\Models\User;
use Tests\TestCase;
class ShowGroupTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('groups.show', Group::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Groups\Ui;
use App\Models\Group;
use App\Models\User;
use Tests\TestCase;
class UpdateGroupTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('groups.edit', Group::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Importing\Ui;
use App\Models\User;
use Tests\TestCase;
class ImportTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('imports.index'))
->assertOk();
}
}

View file

@ -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()
{

View file

@ -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()
{

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Licenses\Ui;
use App\Models\License;
use App\Models\User;
use Tests\TestCase;
class UpdateLicenseTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('licenses.update', License::factory()->create()->id))
->assertOk();
}
}

View file

@ -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());

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Locations\Ui;
use App\Models\Location;
use App\Models\User;
use Tests\TestCase;
class ShowLocationTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('locations.show', Location::factory()->create()->id))
->assertOk();
}
}

View file

@ -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()
{

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Manufacturers\Ui;
use App\Models\User;
use Tests\TestCase;
class CreateManufacturerTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('manufacturers.create'))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Manufacturers\Ui;
use App\Models\User;
use Tests\TestCase;
class IndexManufacturersTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('manufacturers.index'))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Manufacturers\Ui;
use App\Models\Manufacturer;
use App\Models\User;
use Tests\TestCase;
class ShowManufacturerTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('manufacturers.show', Manufacturer::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Manufacturers\Ui;
use App\Models\Manufacturer;
use App\Models\User;
use Tests\TestCase;
class UpdateManufacturerTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('manufacturers.edit', Manufacturer::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\PredefinedKits\Ui;
use App\Models\User;
use Tests\TestCase;
class CreatePredefinedKitTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('kits.create'))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\PredefinedKits\Ui;
use App\Models\User;
use Tests\TestCase;
class IndexPredefinedKitsTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('kits.index'))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\PredefinedKits\Ui;
use App\Models\PredefinedKit;
use App\Models\User;
use Tests\TestCase;
class ShowPredefinedKitTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('kits.show', PredefinedKit::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\PredefinedKits\Ui;
use App\Models\PredefinedKit;
use App\Models\User;
use Tests\TestCase;
class UpdatePredefinedKitTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('kits.edit', PredefinedKit::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\StatusLabels\Ui;
use App\Models\User;
use Tests\TestCase;
class CreateStatusLabelTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('statuslabels.create'))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\StatusLabels\Ui;
use App\Models\User;
use Tests\TestCase;
class IndexStatusLabelsTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('statuslabels.index'))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\StatusLabels\Ui;
use App\Models\Statuslabel;
use App\Models\User;
use Tests\TestCase;
class ShowStatusLabelTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('statuslabels.show', Statuslabel::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\StatusLabels\Ui;
use App\Models\Statuslabel;
use App\Models\User;
use Tests\TestCase;
class UpdateStatusLabelTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('statuslabels.edit', Statuslabel::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Suppliers\Ui;
use App\Models\User;
use Tests\TestCase;
class CreateSupplierTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('suppliers.create'))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Suppliers\Ui;
use App\Models\User;
use Tests\TestCase;
class IndexSuppliersTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('suppliers.index'))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Suppliers\Ui;
use App\Models\Supplier;
use App\Models\User;
use Tests\TestCase;
class ShowSupplierTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('suppliers.show', Supplier::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Tests\Feature\Suppliers\Ui;
use App\Models\Supplier;
use App\Models\User;
use Tests\TestCase;
class UpdateSupplierTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('suppliers.edit', Supplier::factory()->create()->id))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Users\Ui;
use App\Models\User;
use Tests\TestCase;
class CreateUserTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('users.create'))
->assertOk();
}
}

View file

@ -0,0 +1,16 @@
<?php
namespace Tests\Feature\Users\Ui;
use App\Models\User;
use Tests\TestCase;
class IndexUsersTest extends TestCase
{
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('users.index'))
->assertOk();
}
}

View file

@ -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();