Scaffold accessory checkout tests for api

This commit is contained in:
Marcus Moore 2024-01-29 15:59:23 -08:00
parent 987676df08
commit e5d3df7d24
No known key found for this signature in database
2 changed files with 64 additions and 1 deletions

View file

@ -0,0 +1,64 @@
<?php
namespace Tests\Feature\Api\Accessories;
use App\Models\Accessory;
use App\Models\User;
use App\Notifications\CheckoutAccessoryNotification;
use Illuminate\Support\Facades\Notification;
use Tests\Support\InteractsWithSettings;
use Tests\TestCase;
class AccessoryCheckoutTest extends TestCase
{
use InteractsWithSettings;
public function testCheckingOutAccessoryRequiresCorrectPermission()
{
$this->markTestIncomplete();
}
public function testValidation()
{
$this->markTestIncomplete();
}
public function testAccessoryMustBeAvailableWhenCheckingOut()
{
$this->markTestIncomplete();
}
public function testAccessoryCanBeCheckedOut()
{
$this->markTestIncomplete();
}
public function testUserSentNotificationUponCheckout()
{
$this->markTestIncomplete();
$this->withoutExceptionHandling();
Notification::fake();
$accessory = Accessory::factory()->requiringAcceptance()->create();
$user = User::factory()->create();
$this->actingAsForApi(User::factory()->checkoutAccessories()->create())
->postJson(route('api.accessories.checkout', $accessory), [
'assigned_to' => $user->id,
]);
Notification::assertSentTo($user, CheckoutAccessoryNotification::class);
}
public function testActionLogCreatedUponCheckout()
{
$this->markTestIncomplete();
}
public function testUserSentEulaUponCheckoutIfAcceptanceRequired()
{
$this->markTestIncomplete();
}
}

View file

@ -3,7 +3,6 @@
namespace Tests\Feature\Checkouts;
use App\Models\Accessory;
use App\Models\Actionlog;
use App\Models\User;
use App\Notifications\CheckoutAccessoryNotification;
use Illuminate\Support\Facades\Notification;