mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Implement test
This commit is contained in:
parent
391b832613
commit
f708b8b299
|
@ -4,6 +4,7 @@ namespace Tests\Feature\Checkins;
|
||||||
|
|
||||||
use App\Events\CheckoutableCheckedIn;
|
use App\Events\CheckoutableCheckedIn;
|
||||||
use App\Models\Asset;
|
use App\Models\Asset;
|
||||||
|
use App\Models\CheckoutAcceptance;
|
||||||
use App\Models\Statuslabel;
|
use App\Models\Statuslabel;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Notifications\CheckinAssetNotification;
|
use App\Notifications\CheckinAssetNotification;
|
||||||
|
@ -73,9 +74,7 @@ class AssetCheckinTest extends TestCase
|
||||||
public function testLastCheckInFieldIsSetOnCheckin()
|
public function testLastCheckInFieldIsSetOnCheckin()
|
||||||
{
|
{
|
||||||
$admin = User::factory()->superuser()->create();
|
$admin = User::factory()->superuser()->create();
|
||||||
$asset = Asset::factory()->create(['last_checkin' => null]);
|
$asset = Asset::factory()->assignedToUser()->create(['last_checkin' => null]);
|
||||||
|
|
||||||
$asset->checkOut(User::factory()->create(), $admin, now());
|
|
||||||
|
|
||||||
$this->actingAs($admin)
|
$this->actingAs($admin)
|
||||||
->post(route('hardware.checkin.store', [
|
->post(route('hardware.checkin.store', [
|
||||||
|
@ -90,7 +89,14 @@ class AssetCheckinTest extends TestCase
|
||||||
|
|
||||||
public function testPendingCheckoutAcceptancesAreClearedUponCheckin()
|
public function testPendingCheckoutAcceptancesAreClearedUponCheckin()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete();
|
$asset = Asset::factory()->assignedToUser()->create();
|
||||||
|
|
||||||
|
$acceptance = CheckoutAcceptance::factory()->for($asset, 'checkoutable')->pending()->create();
|
||||||
|
|
||||||
|
$this->actingAs(User::factory()->checkinAssets()->create())
|
||||||
|
->post(route('hardware.checkin.store', ['assetId' => $asset->id]));
|
||||||
|
|
||||||
|
$this->assertFalse($acceptance->exists(), 'Acceptance was not deleted');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCheckinTimeAndActionLogNoteCanBeSet()
|
public function testCheckinTimeAndActionLogNoteCanBeSet()
|
||||||
|
|
Loading…
Reference in a new issue