Begin additional test case

This commit is contained in:
Marcus Moore 2024-09-17 09:11:58 -07:00
parent 12fd9cd97a
commit 7b31df7c14
No known key found for this signature in database

View file

@ -3,11 +3,13 @@
namespace Tests\Feature\Checkins\Api;
use App\Models\Accessory;
use App\Models\Company;
use App\Models\User;
use Tests\Concerns\TestsFullMultipleCompaniesSupport;
use Tests\Concerns\TestsPermissionsRequirement;
use Tests\TestCase;
class AccessoryCheckinTest extends TestCase implements TestsPermissionsRequirement
class AccessoryCheckinTest extends TestCase implements TestsFullMultipleCompaniesSupport, TestsPermissionsRequirement
{
public function testRequiresPermission()
{
@ -17,4 +19,24 @@ class AccessoryCheckinTest extends TestCase implements TestsPermissionsRequireme
->postJson(route('api.accessories.checkin', $accessory))
->assertForbidden();
}
public function testAdheresToFullMultipleCompaniesSupportScoping()
{
$this->markTestIncomplete();
$this->withoutExceptionHandling();
[$companyA, $companyB] = Company::factory()->count(2)->create();
$userInCompanyA = User::factory()->for($companyA)->checkinAccessories()->create();
$accessoryForCompanyB = Accessory::factory()->for($companyB)->checkedOutToUser()->create();
$this->settings->enableMultipleFullCompanySupport();
$this->actingAsForApi($userInCompanyA)
->postJson(route('api.accessories.checkin', $accessoryForCompanyB))
->assertStatusMessageIs('error');
// @todo:
}
}